Open danielkwalsh opened 1 year ago
Where did you get your gfortran from? I have found the most reliable method, by far, to be the homebrew one. I use that on all my Macs
I don't recall where it was originally obtained, but I tried to rm
gfortran and then run brew install gcc
to make sure it's using homebrew.
you can run which gfortran
to give more info. For me:
(base) XXXX:~ me$ which gfortran
/opt/homebrew/bin/gfortran
I think that's the issue. I get this:
/usr/local/bin/gfortran
Seems likely. When you install gfortran via homebrew, does it give you some warnings about needing to adjust the PATH
variable?
I don't see any warnings like that, but when I run cmake, I do see this line:
-- The Fortran compiler identification is GNU 13.2.0
That is a very recent compiler, that is good news
Can you show the shell output when you do your cmake command?
cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3ls
-- The Fortran compiler identification is GNU 13.2.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran - broken
CMake Error at /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/CMakeTestFortranCompiler.cmake:61 (message):
The Fortran compiler
"/usr/local/bin/gfortran"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/danielkwalsh/Work/REFPROP-cmake/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_1356f/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_1356f.dir/build.make CMakeFiles/cmTC_1356f.dir/build
Building Fortran object CMakeFiles/cmTC_1356f.dir/testFortranCompiler.f.o
/usr/local/bin/gfortran -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -c /Users/danielkwalsh/Work/REFPROP-cmake/build/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_1356f.dir/testFortranCompiler.f.o
Linking Fortran executable cmTC_1356f
/usr/local/Cellar/cmake/3.22.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1356f.dir/link.txt --verbose=1
/usr/local/bin/gfortran -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk CMakeFiles/cmTC_1356f.dir/testFortranCompiler.f.o -o cmTC_1356f
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_1356f] Error 1
make: *** [cmTC_1356f/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (enable_language)
-- Configuring incomplete, errors occurred!
See also "/Users/danielkwalsh/Work/REFPROP-cmake/build/CMakeFiles/CMakeOutput.log".
See also "/Users/danielkwalsh/Work/REFPROP-cmake/build/CMakeFiles/CMakeError.log".
Hrm. What if you brew uninstall gcc
and brew install gcc
? Something about your installation seems to be messed up.
I'll try that now.
brew uninstall gcc
Error: Refusing to uninstall /usr/local/Cellar/gcc/13.2.0
because it is required by ipopt and openblas, which are currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies gcc
So I did that:
brew uninstall --ignore-dependencies gcc
and then
brew install gcc
It prints out a bunch of stuff, and sometimes mentions that things are already downloaded, but sees to complete with no errors.
Then I run the cmake command again and get what appears to be the same error.
Make sure you delete your build folder before you try again. Otherwise Cmake can use cached things
I just tried re-cloning the whole repo to ensure I didn't make any bad changes, as well as deleting the build folder as you suggested, then re-trying brew uninstall --ignore-dependencies gcc
and brew install gcc
again. I still see the same error.
Looking at the error message you got, it seems like XCode is the culprit, not gfortran
Hmm, so what should I do then?
Ah... Guess what? By following one of your links, I saw someone mention that a conda environment could be the issue. I deactivated my base environment, and I think that may have solved it.
Weird. I will keep that in my brain for future re-use.
Have you guys found a solution to the previous problem? I deactivate the conda env, and I have -- The Fortran compiler identification is GNU 13.2.0
I guess I would suggest to read the links listed above, other than that I have no idea
Hi, I'm having trouble with building REFPROP on a 2.9 GHz 6-Core Intel Core i9 Mac. I've followed the directions in the readme, but when running
cmake .. -DCMAKE_BUILD_TYPE=Release
, I get the following error: `CMake Error at /usr/local/Cellar/cmake/3.22.2/share/cmake/Modules/CMakeTestFortranCompiler.cmake:61 (message): The Fortran compileris not able to compile a simple test program.
It fails with the following output:
I read the section on OSX notes in the readme, and since I don't have an M1, I skipped that portion. I've tried looking around the internet at possible solutions to this, and read that I should instead run this:
cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3
But this also fails with what appears to be the same error.