-
Notifications
You must be signed in to change notification settings - Fork 91
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
Error copying Fortran module "include/schism_glbl.mod" #111
Comments
|
Hi @platipodium,
|
Thanks @jreniel. I did exactly that. The VERBOSE option of make then isolates the culprit line (within the regular
Googling that, I saw a lot of reports on this with older cmake versions, but I am at 3.27 where this issue should be fixed. Another idea was that it might be related to erroneous preprocessing options (which is poorly handled by cmake in mixed gfortran-clang environments, but following up some stack overflow ideas on PREPROCESS_OPTIONS didn't help. I also tried the -J and -M options to place mod files, but to no avail. |
To reproduce, this is my conda configuration
|
Thanks for the clarification, I'll try to reproduce the problem and let you know what I find soon. |
Could you please share the cmake flags you are using to configure cmake? Additionally, I have a 2016 Mac, but it doesn't have an M1 processor, so I might not be able to replicate the error. However, I would argue that given the correct configuration and environment it should compile. Then again, if I'm not mistaken, the M1 processors are ARM processors and I have never seen SCHISM being compiled on ARM architechture. Compiler problems are always fun to debug, but more importantly, I'd like to see this compiled on ARM architechture, that would be cool. |
Oh.. it's been working on Mac M1 for at least a year. On my local laptop through macports. But I have now switched to a conda toolchain. Here's my CMAKE command:
Can you reproduce the error (on linux/conda or Mac/conda)? |
Just a side note, M1/arm64/gfortran toolchain via macports continues to work:
|
The major difference is that there is gfortran/gcc (macports) versus gfortran/clang (conda). And the mix of fortran/c with cmake has been having issues with PREPROCESS_FLAGS (--preprocess versus -cpp) ... but how to connect this to the above error I am not sure. Neither how to fix :=) |
Thanks for adding more context to the problem statement, that does help rule out some possibilities and hone in on potential solutions. |
Hi All. Just to say that I have the same problem on my (old) Mac trying to compile the latest version of SCHISM. I am also using |
Error persists. An update to my previous command for reproducing this is the STANDALONE cmake flag that is now necessary
|
Hi, I am novice here, but have a fairly clean M2 system and am actively working on this (since I need to use it :)), so I can test configs as long as I get reasonable instructions. I am running macOS 14, but no Conda. I installed the pre-reqs via home-brew, fortran, mai, NetCDF-fortran. I was using gcc/clang from apple as default, and went through the make options in the documentation. I was about to install a home-brew gcc (12) and switch to trying the older make. any suggestions? |
Help is greatly appreciated. Most important advise: keep your system clean and document / be able to retrace your steps. Both homebrew and conda install mixed gfortran/clang environments that seem to create difficulties; macports has both gfortran/gcc and gfortran/clang available. Please report how you fare ... |
I think I further along, but not sure. I have switched to attempting the make build instead of cmake. I got past the include/schism_glbl.mod error, but now get a series of these: Core/schism_msgp.F90:1669:19: 1669 | call mpi_irecv(iegsend_2t(1,i),nesend_2t(i),itype,nbrrank_2t(i),16,comm,rrqst(i),ierr) If these are no longer related to this thread I will search somewhere else, or post to the mailing list. Thanks! |
Just $0.02 here -- I finally got what I think is a successful build on Sonoma/M2. I installed: via homebrew. In my SCHISM.local.myown I included gcc-13 I then followed the cmake instructions; then 'make pschism' resulting binary gave me: epictetus:bin gbsmith$ sudo ./pschism_mac_epictetus_TVD-VL -v schism v5.11.1 |
@fred116 How did you achieve mpich to use gcc? For me brew continues to use clang:
... and then run into the mixed gfortran/clang trap. Please check which mpich you're using, and post your SCHISM.local.myown |
@fred116 you should not have to run |
OK, I got it.
So we do have it working on gcc/gfortran toolchain, but still not clang/gfortran :=( |
I will post the info tomorrow; sorry I missed the post today…
… On Mar 5, 2024, at 1:29 AM, Carsten Lemmen ***@***.***> wrote:
@fred116 How did you achieve mpich to use gcc? For me brew continues to use clang:
❯ which mpicc && mpicc --version
/opt/homebrew/bin/mpicc
clang version 16.0.6
... and then run into the mixed gfortran/clang trap. Please check which epic you're using, and post your SCHISM.local.myown
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I would rather not run as sudo, but I am forced to work in a managed environment, and I haven’t gotten the permissions right somewhere in my build chain, so the end binary gives a macOS permissions error, even though the binary has wide open permissions (chmod a+rwx)…
:(
… On Mar 5, 2024, at 4:32 AM, Carsten Lemmen ***@***.***> wrote:
epictetus:bin gbsmith$ sudo ./pschism_mac_epictetus_TVD-VL -v
@fred116 you should not have to run pschism with sudo. On the other hand, you show how much you trust us :=)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I added the homebrew cmake recipe as
|
Hi All. I finally had some time to work on this and it turns out it's the preprocessing. Removing it from the @platipodium see if it works for you as well. I have encoded the change into the #Fix OSX issue with preprocessing
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i -e "s|add_compile_options(\${C_PREPROCESS_FLAG})|#add_compile_options(\${C_PREPROCESS_FLAG})|g" src/CMakeLists.txt
sed -i -e "s|add_definitions(\${C_PREPROCESS_FLAG})|#add_definitions(\${C_PREPROCESS_FLAG})|g" src/Utility/Combining_Scripts/CMakeLists.txt
sed -i -e "s|add_definitions(\${C_PREPROCESS_FLAG})|#add_definitions(\${C_PREPROCESS_FLAG})|g" src/Utility/Post-Processing-Fortran/CMakeLists.txt
fi There might also be a way to fix that by passing the right argument. In |
I have tried with several options to change the option in So another way to achieve the same as above (thanks @pmav99) is the following: ❯ git diff ../cmake/SCHISMCompile.cmake
diff --git a/cmake/SCHISMCompile.cmake b/cmake/SCHISMCompile.cmake
index 72c558a6..e388d1fd 100644
--- a/cmake/SCHISMCompile.cmake
+++ b/cmake/SCHISMCompile.cmake
@@ -16,7 +16,7 @@ if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -debug inline_debug_info ${SCHISM_INTEL_OPTIONS}")
set( C_PREPROCESS_FLAG CACHE STRING "C Preprocessor Flag")
endif()
-
+
endif()
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM")
@@ -39,9 +39,9 @@ if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g ${SCHISM_GFORTRAN_OPTIONS}")
unset( C_PREPROCESS_FLAG CACHE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
- set( C_PREPROCESS_FLAG "--preprocess" CACHE STRING "C Preprocessor Flag")
+ set( C_PREPROCESS_FLAG "" CACHE STRING "C Preprocessor Flag")
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
- set( C_PREPROCESS_FLAG "--preprocess" CACHE STRING "C Preprocessor Flag")
+ set( C_PREPROCESS_FLAG "" CACHE STRING "C Preprocessor Flag")
else()
set( C_PREPROCESS_FLAG "-cpp" CACHE STRING "C Preprocessor Flag")
endif() |
Thanks @brey for suggesting this. I have not tried yet, but this approach does not seem to resolve the issue within the CMake strutter unmixed gfortran/clang, or depends on |
Just to clarify, there is no My name: schism-openmpi-dev
channels:
- conda-forge
dependencies:
- python=3
- gfortran_osx-64
- openmpi-mpicxx
- openmpi-mpifort
- netcdf-fortran=4.5.3=mpi_openmpi_*
- cmake
- parmetis
- metis |
Great! can you tell me the outcome of your |
❯ mpicc --version
clang version 16.0.6
Target: x86_64-apple-darwin13.4.0
Thread model: posix
InstalledDir: /Users/brey/mambaforge/envs/schism-openmpi-dev/bin ❯ mpifort --version
GNU Fortran (GCC) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ❯ which mpifort
/Users/brey/mambaforge/envs/schism-openmpi-dev/bin/mpifort |
On Mac M1 in a conda environment (gfortran-clang) my build fails with
Any ideas?
The text was updated successfully, but these errors were encountered: