Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with OpenMP does not add required flags, which leads to linking failure #17

Open
barracuda156 opened this issue Jul 26, 2024 · 0 comments

Comments

@barracuda156
Copy link

Building with OpenMP enabled does not actually enable OpenMP, since -fopenmp is passed neither to the compiler nor to the linker. In result:

[ 96%] Building C object CMakeFiles/asl.dir/src/solvers/value.c.o
/opt/local/bin/gcc-mp-14 -Dasl_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -m32 -arch ppc -mmacosx-version-min=10.6 -fPIC -Wno-parentheses -MD -MT CMakeFiles/asl.dir/src/solvers/value.c.o -MF CMakeFiles/asl.dir/src/solvers/value.c.o.d -o CMakeFiles/asl.dir/src/solvers/value.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers/value.c
[ 97%] Building C object CMakeFiles/asl.dir/src/solvers/writesol.c.o
/opt/local/bin/gcc-mp-14 -Dasl_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -m32 -arch ppc -mmacosx-version-min=10.6 -fPIC -Wno-parentheses -MD -MT CMakeFiles/asl.dir/src/solvers/writesol.c.o -MF CMakeFiles/asl.dir/src/solvers/writesol.c.o.d -o CMakeFiles/asl.dir/src/solvers/writesol.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers/writesol.c
[ 97%] Building C object CMakeFiles/asl.dir/src/solvers/wrtsol_.c.o
/opt/local/bin/gcc-mp-14 -Dasl_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -m32 -arch ppc -mmacosx-version-min=10.6 -fPIC -Wno-parentheses -MD -MT CMakeFiles/asl.dir/src/solvers/wrtsol_.c.o -MF CMakeFiles/asl.dir/src/solvers/wrtsol_.c.o.d -o CMakeFiles/asl.dir/src/solvers/wrtsol_.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers/wrtsol_.c
[ 97%] Linking C shared library bin/libasl-mt.dylib
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/asl-mt.dir/link.txt --verbose=ON
/opt/local/bin/gcc-mp-14 -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -m32 -arch ppc -mmacosx-version-min=10.6 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -o bin/libasl-mt.dylib -install_name /opt/local/lib/libasl-mt.dylib "CMakeFiles/asl-mt.dir/include/details.c.o" "CMakeFiles/asl-mt.dir/src/solvers/asldate.c.o" "CMakeFiles/asl-mt.dir/src/solvers/atof.c.o" "CMakeFiles/asl-mt.dir/src/solvers/auxinfo.c.o" "CMakeFiles/asl-mt.dir/src/solvers/avltree.c.o" "CMakeFiles/asl-mt.dir/src/solvers/b_search.c.o" "CMakeFiles/asl-mt.dir/src/solvers/basename.c.o" "CMakeFiles/asl-mt.dir/src/solvers/bscanf.c.o" "CMakeFiles/asl-mt.dir/src/solvers/com2eval.c.o" "CMakeFiles/asl-mt.dir/src/solvers/comeval.c.o" "CMakeFiles/asl-mt.dir/src/solvers/con1ival.c.o" "CMakeFiles/asl-mt.dir/src/solvers/con2ival.c.o" "CMakeFiles/asl-mt.dir/src/solvers/con2val.c.o" "CMakeFiles/asl-mt.dir/src/solvers/conadj.c.o" "CMakeFiles/asl-mt.dir/src/solvers/conpval.c.o" "CMakeFiles/asl-mt.dir/src/solvers/conscale.c.o" "CMakeFiles/asl-mt.dir/src/solvers/conval.c.o" "CMakeFiles/asl-mt.dir/src/solvers/degree.c.o" "CMakeFiles/asl-mt.dir/src/solvers/derprop.c.o" "CMakeFiles/asl-mt.dir/src/solvers/dtoa1.c.o" "CMakeFiles/asl-mt.dir/src/solvers/duthes.c.o" "CMakeFiles/asl-mt.dir/src/solvers/dynlink.c.o" "CMakeFiles/asl-mt.dir/src/solvers/f_read.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fg_read.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fg_write.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fgh_read.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fpecatch.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fpinit.c.o" "CMakeFiles/asl-mt.dir/src/solvers/fullhes.c.o" "CMakeFiles/asl-mt.dir/src/solvers/func_add.c.o" "CMakeFiles/asl-mt.dir/src/solvers/funcadd1.c.o" "CMakeFiles/asl-mt.dir/src/solvers/g_fmt.c.o" "CMakeFiles/asl-mt.dir/src/solvers/genrowno.c.o" "CMakeFiles/asl-mt.dir/src/solvers/getenv.c.o" "CMakeFiles/asl-mt.dir/src/solvers/getstub.c.o" "CMakeFiles/asl-mt.dir/src/solvers/htcl.c.o" "CMakeFiles/asl-mt.dir/src/solvers/indic_cons.c.o" "CMakeFiles/asl-mt.dir/src/solvers/jac0dim.c.o" "CMakeFiles/asl-mt.dir/src/solvers/jac2dim.c.o" "CMakeFiles/asl-mt.dir/src/solvers/jacdim.c.o" "CMakeFiles/asl-mt.dir/src/solvers/jacinc.c.o" "CMakeFiles/asl-mt.dir/src/solvers/jacinc1.c.o" "CMakeFiles/asl-mt.dir/src/solvers/libnamsave.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mach.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mainexit.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mip_pri.c.o" "CMakeFiles/asl-mt.dir/src/solvers/misc.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mpec_adj.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mqpcheckv.c.o" "CMakeFiles/asl-mt.dir/src/solvers/mypow.c.o" "CMakeFiles/asl-mt.dir/src/solvers/names.c.o" "CMakeFiles/asl-mt.dir/src/solvers/nl_obj.c.o" "CMakeFiles/asl-mt.dir/src/solvers/nqpcheck.c.o" "CMakeFiles/asl-mt.dir/src/solvers/obj2val.c.o" "CMakeFiles/asl-mt.dir/src/solvers/obj_adj.c.o" "CMakeFiles/asl-mt.dir/src/solvers/obj_prec.c.o" "CMakeFiles/asl-mt.dir/src/solvers/objconst.c.o" "CMakeFiles/asl-mt.dir/src/solvers/objval.c.o" "CMakeFiles/asl-mt.dir/src/solvers/objval_.c.o" "CMakeFiles/asl-mt.dir/src/solvers/op_type.c.o" "CMakeFiles/asl-mt.dir/src/solvers/pfg_read.c.o" "CMakeFiles/asl-mt.dir/src/solvers/pfghread.c.o" "CMakeFiles/asl-mt.dir/src/solvers/printf.c.o" "CMakeFiles/asl-mt.dir/src/solvers/pshvprod.c.o" "CMakeFiles/asl-mt.dir/src/solvers/punknown.c.o" "CMakeFiles/asl-mt.dir/src/solvers/qp_read.c.o" "CMakeFiles/asl-mt.dir/src/solvers/qpcheck.c.o" "CMakeFiles/asl-mt.dir/src/solvers/qsortv.c.o" "CMakeFiles/asl-mt.dir/src/solvers/readsol.c.o" "CMakeFiles/asl-mt.dir/src/solvers/repwhere.c.o" "CMakeFiles/asl-mt.dir/src/solvers/rops.c.o" "CMakeFiles/asl-mt.dir/src/solvers/rops2.c.o" "CMakeFiles/asl-mt.dir/src/solvers/sigcatch.c.o" "CMakeFiles/asl-mt.dir/src/solvers/sos_add.c.o" "CMakeFiles/asl-mt.dir/src/solvers/sphes.c.o" "CMakeFiles/asl-mt.dir/src/solvers/sscanf.c.o" "CMakeFiles/asl-mt.dir/src/solvers/stderr.c.o" "CMakeFiles/asl-mt.dir/src/solvers/studchk0.c.o" "CMakeFiles/asl-mt.dir/src/solvers/suf_sos.c.o" "CMakeFiles/asl-mt.dir/src/solvers/value.c.o" "CMakeFiles/asl-mt.dir/src/solvers/writesol.c.o" "CMakeFiles/asl-mt.dir/src/solvers/wrtsol_.c.o" "CMakeFiles/asl-mt.dir/src/solvers/ws_desc.c.o" "CMakeFiles/asl-mt.dir/src/solvers/wsu_desc.c.o" "CMakeFiles/asl-mt.dir/src/solvers/x2check.c.o" "CMakeFiles/asl-mt.dir/src/solvers/xectim.c.o" "CMakeFiles/asl-mt.dir/src/solvers/xp1known.c.o" "CMakeFiles/asl-mt.dir/src/solvers/xp2known.c.o"  -Wl,-rpath,/opt/local/lib -lm
[ 97%] Building C object CMakeFiles/asl.dir/src/solvers/ws_desc.c.o
/opt/local/bin/gcc-mp-14 -Dasl_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers -pipe -Os -DNDEBUG -I/opt/local/include -arch ppc -m32 -arch ppc -mmacosx-version-min=10.6 -fPIC -Wno-parentheses -MD -MT CMakeFiles/asl.dir/src/solvers/ws_desc.c.o -MF CMakeFiles/asl.dir/src/solvers/ws_desc.c.o.d -o CMakeFiles/asl.dir/src/solvers/ws_desc.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_asl/asl/work/asl-2f5d9de248c53a3063bba23af2013cd3db768bf8/src/solvers/ws_desc.c
Undefined symbols:
  "_omp_init_lock", referenced from:
      _init_dtoa_locks in dtoa1.c.o
      _init_dtoa_locks in dtoa1.c.o
  "_omp_get_thread_num", referenced from:
      _get_TI in dtoa1.c.o
  "_omp_unset_lock", referenced from:
      _Bfree in dtoa1.c.o
      _FREE_DTOA_LOCK in dtoa1.c.o
      _Balloc in dtoa1.c.o
      _pow5mult in dtoa1.c.o
      _pow5mult in dtoa1.c.o
  "_omp_set_lock", referenced from:
      _Bfree in dtoa1.c.o
      _ACQUIRE_DTOA_LOCK in dtoa1.c.o
      _Balloc in dtoa1.c.o
      _pow5mult in dtoa1.c.o
      _pow5mult in dtoa1.c.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status

Passing -fopenmp manually fixes it, but normally this should not be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant