fson
fson copied to clipboard
CMake build fails to link to libzofu on macOS, meson build works fine
[ 58%] Linking Fortran executable zofu-driver
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/zofu-driver.dir/link.txt --verbose=ON
/opt/local/bin/gfortran-mp-12 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -pipe -Os -m32 -mmacosx-version-min=10.6 "CMakeFiles/zofu-driver.dir/_deps/zofu-src/src/zofu_driver.F90.o" -o zofu-driver -Wl,-rpath,/opt/local/lib libzofu.dylib
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9'
[ 58%] Built target zofu-driver
/usr/bin/make -f CMakeFiles/fson_test.dir/build.make CMakeFiles/fson_test.dir/depend
/usr/bin/make -f CMakeFiles/fson_test2.dir/build.make CMakeFiles/fson_test2.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9'
make[2]: Entering directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9'
/opt/local/bin/cmake -E cmake_copy_f90_mod fson_test.mod CMakeFiles/fson_test_lib.dir/fson_test.mod.stamp GNU
[ 62%] Generating fson_test_driver.f90
./zofu-driver /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/fson-1.0.5/src/tests/fson_test_zofu.f90 /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/fson-1.0.5/fson_test_driver.f90
[ 66%] Generating fson_test2_driver.f90
./zofu-driver /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/fson-1.0.5/src/tests/fson_test2_zofu.f90 /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/fson-1.0.5/fson_test2_driver.f90
dyld: Library not loaded: /opt/local/lib/libzofu.dylib
Referenced from: /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9/zofu-driver
Reason: image not found
dyld: Library not loaded: /opt/local/lib/libzofu.dylib
Referenced from: /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9/zofu-driver
Reason: image not found
[ 70%] Linking Fortran shared library libfson_test_lib.dylib
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/fson_test_lib.dir/link.txt --verbose=ON
/opt/local/bin/cmake -E touch CMakeFiles/fson_test_lib.dir/src/tests/fson_test_zofu.f90.o.provides.build
make[2]: *** [fson_test_driver.f90] Trace/BPT trap
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9'
make[1]: *** [CMakeFiles/fson_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [fson_test2_driver.f90] Trace/BPT trap
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_fson/fson/work/josephalevin-fson-16731d9'
make[1]: *** [CMakeFiles/fson_test2.dir/all] Error 2
@kprussing, can you shed any light on this error? My own knowledge of CMake is very limited.
Sorry. It's been a busy couple of weeks.
@barracuda156 , ~~is this trying to build via the MacPorts mechanism? I did a check and don't see son as available from MacPorts. It could be related to that, but #31 could just solve the problem.~~ I'll take a look when I have some down time.
Taking a second look, this appears to be a MacPorts build problem. During the build phase, MacPorts told zofu-driver
through CMake to look for libzofu.dylib
in /opt/local/lib
(the final location) and not in the build directory.
@kprussing I have added it to Macports. When I opened the ticket, it was not yet there. Since CMake build did not work correctly, I just went with meson.
I noticed fson made it into MacPorts after I posted. I hadn't updated MacPorts in a few weeks, but once I did, it was there.