Final update: I was able to configure and compile the latest version of ASPECT. Attached is my Candi config file. After adding “source INSTALL_PATH/configuration/enable.sh” to my .zshrc file , my environment looks like this. The versions of mpicc, mpicxx, mpifort are all “GNU Fortran (Homebrew GCC 11.4.0) 11.4.0” and I used cmake version 3.29.3.
Thanks for the update @mkerr and glad it working on your system!
Were you ale to successfully run an ASPECT model?
deal.II also compiled successfully on my end (likely CMAKE_CXX_COMPILER was also the issue), but the most recent version of ASPECT does not compile and executing aspect from version 2.5 (builds without issue) results in a malloc error.
@jbnaliboff I’m sorry; I definitely spoke too soon. I was able to configure but I forgot to follow the last step, and yeah I can’t build the latest version either.
mkerr@igpp20grad7 build % make
[ 1%] Building Fortran object world_builder/CMakeFiles/WorldBuilderDebug.dir/source/world_builder/wrapper_fortran.f90.o
[ 1%] Building CXX object world_builder/CMakeFiles/WorldBuilderDebug.dir/Unity/unity_0_cxx.cxx.o
In file included from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/coordinate_systems/interface.h:26,
from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/coordinate_systems/cartesian.h:23,
from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/source/world_builder/coordinate_systems/cartesian.cc:20,
from /Users/mkerr/ASPECT_hackathon/code/aspect/build/world_builder/CMakeFiles/WorldBuilderDebug.dir/Unity/unity_0_cxx.cxx:4:
/Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/parameters.h:23:10: fatal error: map: No such file or directory
23 | #include <map>
| ^~~~~
compilation terminated.
make[2]: *** [world_builder/CMakeFiles/WorldBuilderDebug.dir/Unity/unity_0_cxx.cxx.o] Error 1
make[1]: *** [world_builder/CMakeFiles/WorldBuilderDebug.dir/all] Error 2
make: *** [all] Error 2
mkerr@igpp20grad7 build %
is the error I get; is that the same for you?
edit: I configured aspect 2.5 but also had the same build error so I might still have some underlying issue.
edit2: I have “World Builder not found. Using internal version.” in my config output which is the same thing that failed my build
Oh no, I was hoping some small tweak on my end would get it working!
is the error I get; is that the same for you?
Yes, that’s the same one. I haven’t seen that before on any linux build, so I think it is likely something associated with the mac setups.
edit: I configured aspect 2.5 but also had the same build error so I might still have some underlying issue.
Hmmm. Did you make a new build directory before configuring? I checkout version 2.5 via git, made a new build directory, and then compiled. However, this still led to the runtime malloc error.
I think I saw this issue 1 or 2 years ago, but at the time the deal.II dmg was working so just moved on.
I’m nearly ready to throw in the towel and just use the docker route. I was able to connect vs code to a running docker container following these instructions, so the development experience is really not that different at all. However, happy to keep trying a few more things on my side if that would be helpful in replicating or confirming issues/solutions!
Something has gone terribly wrong if a C++ compiler can’t find <map> Are you perhaps trying to compile that file with a C compiler, for example because you accidentally set CXX to mpicc or some such? You can probably see which compiler is being called if you call make with
@jbnaliboff , this was just me being dumb. I went into the 2.5 branch to get the link to clone it, but then used the same git clone as the main branch without the flag to clone the 2.5 branch. I’ll confirm that.
Sorry to get your hopes up re the build though; I was stuck on dealii for so long I jumped the gun
I’ll try the docker and keep poking around at this.
@jbnaliboff I could build 2.5 and I could also run it without a malloc error(although I do remember getting these in the past). I ran the convection-box cookbook successfully with aspect 2.5. But still no luck for 2.6. I am working with docker now; I’ve never used it before but I do use VS code so I’m sure I can figure it out before Tuesday. I know the documentation recommends downloading a pre-compiled ASPECT image from docker hub, and I’m wondering if we should build our own image for our own fork? I’m also still figuring out exactly what docker is a does so pardon if my question is garbled.
Once docker is installed, you can run docker pull geodynamics/aspect to get the aspect docker container (contains deal.II 9.5.1 + main branch of aspect). docker run -it geodynamics/aspect will start the container, and then you can connect VS code to the running container.
I’m out of ideas for the native build, but your installation is farther along than mine (aspect at least runs after being built) and @bangerth may see something or think of a diagnostic test that pinpoints the issue.
A great idea, I think the problem is in the flag “-stdlib=libc++”. I am compiling my program “JIM” (just include maps) which is
#include <map>
int main()
{
}
And I did a little binary search type thing to find the problematic flag. They seem to be “-stdlib=libc++” which gives the error that I see in compiling aspect and then -MT which breaks it in a different way
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -DVTU11_ENABLE_ZLIB -DWB_WITH_MPI -DWB_WITH_ZLIB -I/Users/mkerr/ASPECT_hackathon/code/aspect/include -I/Users/mkerr/ASPECT_hackathon/code/aspect/build/include -I/Users/mkerr/ASPECT_hackathon/code/aspect/contrib/catch -I/Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include -I/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -I/Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/tests -I/Users/mkerr/ASPECT_hackathon/code/aspect/build/world_builder/include -std=gnu++14 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=13.5 -std=c++14 just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -stdlib=libc++ -Wuninitialized -Werror=uninitialized -Wdangling-else -g -MD -MT just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
collect2: error: ld returned 1 exit status
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -stdlib=libc++ just_include_map.cxx -o JIM
just_include_map.cxx:1:10: fatal error: map: No such file or directory
1 | #include <map>
| ^~~~~
compilation terminated.
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wuninitialized -Werror=uninitialized -Wdangling-else -g -MD -MT just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
collect2: error: ld returned 1 exit status
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests %
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -stdlib=libc++ -Wuninitialized -Werror=uninitialized -Wdangling-else -g -MD -MT just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
collect2: error: ld returned 1 exit status
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wuninitialized just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wuninitialized -Werror=uninitialized -Wdangling-else -g -MD -MT just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
collect2: error: ld returned 1 exit status
mkerr@igpp20grad7 tests % /usr/local/bin/mpicxx -Wpointer-arith -Wwrite-strings -Wsynth -Wsign-compare -Woverloaded-virtual -Wno-literal-range -Wno-parentheses -Wno-unused-local-typedefs -Wcast-qual -fstrict-aliasing -Wuninitialized -Werror=uninitialized -Wdangling-else -g -MD just_include_map.cxx -o JIM
-macosx_version_min has been renamed to -macos_version_min
Also I noticed these two flags “-std=gnu++14 -std=c++14” were using version 14 instead of 11 even though mpicxx version is gnu 11
I was able to get the latest version of aspect to run on docker! whew. Then I did a little more digging to see how docker works when developing code that is in the docker container. I think I can make this work if I cant get the native installation in time. Thank you so much for your help!
Good sleuthing! The issue with numbers is confusing, but harmless. The version number of the compiler is 11, and you are requesting to use the C++14 standard. These two are independent.
As for -stdlib=libc++: This is interesting. There are basically only two big C++ compilers left in the field that can run on Mac and Linux, GCC and clang/LLVM. Both of these two projects have written versions of the C++ standard library that implement things such as the <map> header file that implements std::map. GCC has developed libstdc++ and the clang/LLVM folks have developed libc++. Both compilers by default use their own library, but can also use the other compiler’s library. That’s what’s happening here: mpicxx is set up to use the GCC compiler with the libc++ standard library. I believe that this kind of setup is not uncommon on Mac OS X.
What I think is happening is that on your system, libc++ is not installed in a way that allows for compiling programs. That is, the library libc++.so may be there (which every executable build with C++ needs), but the header files may not (which you’d need to compile executables). I don’t know how to fix this, but perhaps with the description above you can find something on the internet that explains how to implement the missing parts of libc++…
Thank you for thinking about this. I guess I’m confused why ASPECT 2.5 would be able to compile and run on my computer with the same environment/path everything. Is there something different about version 2.6 in terms of the way ASPECT interacts with libc++ or needing a specific version of the c++ standard library? Regardless, I have Docker working and can use version 2.6 in that way, so I might just call it here for now. Thank you again for your help, and I look forward to meeting you soon!
@mkerr - A heads up regarding docker - after cloning my own aspect repo inside the ASPECT docker container, I kept running into an issue of loosing connectivity with the docker image when actually building aspect.
I turned off the unity build for WB and ASPECT in CMakeCache.txt, and now both build without issue.
No idea what the underlying issue is, but posting this just in case you or someone else run into the same issue…
Thanks for the hint. I’m not still not able to compile 2.6 but I can still compile and run 2.5. When I went to edit the CMakeCache.txt file to turn off Unity build for Aspect and WB, and then when I ran make, it just reconfigured aspect again so I turned it off in CMakeList.txt in the main aspect directory. That didn’t work either. I’m going to try a build inside the aspect container later this evening and hopefully that works.
[ 0%] Building Fortran object world_builder/CMakeFiles/WorldBuilderDebug.dir/source/world_builder/wrapper_fortran.f90.o
[ 0%] Building CXX object world_builder/CMakeFiles/WorldBuilderDebug.dir/source/world_builder/coordinate_systems/cartesian.cc.o
In file included from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/coordinate_systems/interface.h:26,
from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/coordinate_systems/cartesian.h:23,
from /Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/source/world_builder/coordinate_systems/cartesian.cc:20:
/Users/mkerr/ASPECT_hackathon/code/aspect/contrib/world_builder/include/world_builder/parameters.h:23:10: fatal error:map: No such file or directory
23 | #include <map>
| ^~~~~
compilation terminated.
make[2]: *** [world_builder/CMakeFiles/WorldBuilderDebug.dir/source/world_builder/coordinate_systems/cartesian.cc.o] Error 1
make[1]: *** [world_builder/CMakeFiles/WorldBuilderDebug.dir/all] Error 2
make: *** [all] Error 2
@mkerr I must admit that I have no idea where the -stdlib=libc++ comes from and why that would be different between ASPECT 2.5 and 2.6 Maybe someone else has an idea?
Best
W.