DOI-BOR / ostrich

An optimization toolkit for model calibration
GNU General Public License v2.0
1 stars 1 forks source link

compiling on a mac: library 'stdc++fs' not found #46

Open mchernos opened 3 months ago

mchernos commented 3 months ago

Hi,

When compiling on MacOS, using make GCC we get the following error (tested on several macs from 2018 onwards):

ld: library 'stdc++fs' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [GCC] Error 1

Following https://stackoverflow.com/questions/74891427/make-error-library-not-found-for-lstdcfs we were able to compile by removing the -lstdc++fs in the makefile. i.e.

GCC:    $(SRC_FILES_CPP) $(SRC_FILES_C)
    g++ -std=c++17 -I$(INCLUDE_DIR) -I$(MPI_MEM_INCLUDE) $(SRC_FILES_CPP) $(MEM_FILES_C) -ldl -o Ostrich
    rm -f *.o
dloney commented 3 months ago

I think this is most likely a structural difference between Mac and Linux C++ libraries and compiler versions. I just recompiled again today on Linux, and the flag was necessary to include it on relatively new versions of RedHad and OpenSUSE. @lbearup We could modify the make file with an architecture input that would disable the filesystem flag until all the GCC compilers came standard with it?