Problems compiling using gcc version 7
I am trying to compile nektar++-4.4.0 on archlinux (actually manjaro but close enough...). This uses a recent version of gcc (gcc-7.1.1) and I am experiencing what, at first sight is a very weird error: cd /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/library/LibUtilities && /usr/bin/c++ -DLIB_UTILITIES_EXPORTS -DLibUtilities_EXPORTS -DNEKTAR_MEMORY_POOL_ENABLED -DNEKTAR_USING_BLAS -DNEKTAR_USING_LAPACK -DNEKTAR_VERSION=\"4.4.0\" -DTIXML_USE_STL -isystem /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/ThirdParty/dist/include -isystem /usr/lib/../include -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0 -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library -g -DNEKTAR_DEBUG -Wall -Wno-deprecated -Wno-sign-compare -fpermissive -fPIC -fPIC -o CMakeFiles/LibUtilities.dir/BasicUtils/ArrayEqualityComparison.cpp.o -c /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayEqualityComparison.cpp In file included from /usr/include/c++/7.1.1/ext/string_conversions.h:41:0, from /usr/include/c++/7.1.1/bits/basic_string.h:6159, from /usr/include/c++/7.1.1/string:52, from /usr/include/c++/7.1.1/stdexcept:39, from /usr/include/c++/7.1.1/array:39, from /usr/include/c++/7.1.1/tuple:39, from /usr/include/c++/7.1.1/bits/stl_map.h:63, from /usr/include/c++/7.1.1/map:61, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicConst/NektarUnivTypeDefs.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayPolicies.hpp:40, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/SharedArray.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayEqualityComparison.cpp:35: /usr/include/c++/7.1.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> ^~~~~~~~~~ I tracked down the error and the problem occurs in newer versions of C++ (6 and newer I think) where including system directories such as /usr/include messes up things. The gcc guys say that this is an issue with the build system and not gcc and they won't do anything about it as you can see in the following link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129 To confirm this, I tried compiling by hand the file where the error was generated above after removing from the compile command the part -isystem /usr/lib/../include and the file compiled just fine. I tried to locate where is this compilation directive coming from but couldn't find it in any of the cmake files. But I don't know cmake very well and I have no idea how to debug it. By the way, if I install gcc version 5 on my system, as expected, nektar compiles. I will try to compile nektar++ with clang++ to see what happens. This error will become more common as new versions of gcc start becoming more common (I think newer versions of ubuntu already use gcc 6.x). The quickest fix is to install gcc version 5. Thanks Paulo Jabardo
Hi Paulo, Can you try the feature/boost-std-cleanup branch on gitlab? I'm fairly sure it removes a lot of the -isystem includes precisely for this reason and might solve your issue. Thanks, Dave
On 29 Aug 2017, at 17:04, Paulo Jabardo <pjabardo@gmail.com> wrote:
I am trying to compile nektar++-4.4.0 on archlinux (actually manjaro but close enough...). This uses a recent version of gcc (gcc-7.1.1) and I am experiencing what, at first sight is a very weird error:
cd /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/library/LibUtilities && /usr/bin/c++ -DLIB_UTILITIES_EXPORTS -DLibUtilities_EXPORTS -DNEKTAR_MEMORY_POOL_ENABLED -DNEKTAR_USING_BLAS -DNEKTAR_USING_LAPACK -DNEKTAR_VERSION=\"4.4.0\" -DTIXML_USE_STL -isystem /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/ThirdParty/dist/include -isystem /usr/lib/../include -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0 -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library -g -DNEKTAR_DEBUG -Wall -Wno-deprecated -Wno-sign-compare -fpermissive -fPIC -fPIC -o CMakeFiles/LibUtilities.dir/BasicUtils/ArrayEqualityComparison.cpp.o -c /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayEqualityComparison.cpp In file included from /usr/include/c++/7.1.1/ext/string_conversions.h:41:0, from /usr/include/c++/7.1.1/bits/basic_string.h:6159, from /usr/include/c++/7.1.1/string:52, from /usr/include/c++/7.1.1/stdexcept:39, from /usr/include/c++/7.1.1/array:39, from /usr/include/c++/7.1.1/tuple:39, from /usr/include/c++/7.1.1/bits/stl_map.h:63, from /usr/include/c++/7.1.1/map:61, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicConst/NektarUnivTypeDefs.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayPolicies.hpp:40, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/SharedArray.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/BasicUtils/ArrayEqualityComparison.cpp:35: /usr/include/c++/7.1.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> ^~~~~~~~~~
I tracked down the error and the problem occurs in newer versions of C++ (6 and newer I think) where including system directories such as /usr/include messes up things.
The gcc guys say that this is an issue with the build system and not gcc and they won't do anything about it as you can see in the following link:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
To confirm this, I tried compiling by hand the file where the error was generated above after removing from the compile command the part
-isystem /usr/lib/../include
and the file compiled just fine.
I tried to locate where is this compilation directive coming from but couldn't find it in any of the cmake files. But I don't know cmake very well and I have no idea how to debug it.
By the way, if I install gcc version 5 on my system, as expected, nektar compiles.
I will try to compile nektar++ with clang++ to see what happens.
This error will become more common as new versions of gcc start becoming more common (I think newer versions of ubuntu already use gcc 6.x). The quickest fix is to install gcc version 5.
Thanks
Paulo Jabardo _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Paulo, Just to complement Dave's answer, I think many of the cmake changes he mentioned are already in the master branch of the repository. You could try that first to see if it fixes the problem. 2017-08-29 16:10 GMT-03:00 David Moxey <d.moxey@imperial.ac.uk>:
Hi Paulo,
Can you try the feature/boost-std-cleanup branch on gitlab? I'm fairly sure it removes a lot of the -isystem includes precisely for this reason and might solve your issue.
Thanks,
Dave
On 29 Aug 2017, at 17:04, Paulo Jabardo <pjabardo@gmail.com> wrote:
I am trying to compile nektar++-4.4.0 on archlinux (actually manjaro but close enough...). This uses a recent version of gcc (gcc-7.1.1) and I am experiencing what, at first sight is a very weird error:
cd /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/library/LibUtilities && /usr/bin/c++ -DLIB_UTILITIES_EXPORTS -DLibUtilities_EXPORTS -DNEKTAR_MEMORY_POOL_ENABLED -DNEKTAR_USING_BLAS -DNEKTAR_USING_LAPACK -DNEKTAR_VERSION=\"4.4.0\" -DTIXML_USE_STL -isystem /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/build-debug/ThirdParty/dist/include -isystem /usr/lib/../include -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0 -I/home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library -g -DNEKTAR_DEBUG -Wall -Wno-deprecated -Wno-sign-compare -fpermissive -fPIC -fPIC -o CMakeFiles/LibUtilities.dir/BasicUtils/ArrayEqualityComparison.cpp.o -c /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/library/LibUtilities/ BasicUtils/ArrayEqualityComparison.cpp In file included from /usr/include/c++/7.1.1/ext/ string_conversions.h:41:0, from /usr/include/c++/7.1.1/bits/basic_string.h:6159, from /usr/include/c++/7.1.1/string:52, from /usr/include/c++/7.1.1/stdexcept:39, from /usr/include/c++/7.1.1/array:39, from /usr/include/c++/7.1.1/tuple:39, from /usr/include/c++/7.1.1/bits/stl_map.h:63, from /usr/include/c++/7.1.1/map:61, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/ library/LibUtilities/BasicConst/NektarUnivTypeDefs.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/ library/LibUtilities/BasicUtils/ArrayPolicies.hpp:40, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/ library/LibUtilities/BasicUtils/SharedArray.hpp:39, from /home/pjabardo/misc/math/nektar++/nektar++-4.4.0/ library/LibUtilities/BasicUtils/ArrayEqualityComparison.cpp:35: /usr/include/c++/7.1.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> ^~~~~~~~~~
I tracked down the error and the problem occurs in newer versions of C++ (6 and newer I think) where including system directories such as /usr/include messes up things.
The gcc guys say that this is an issue with the build system and not gcc and they won't do anything about it as you can see in the following link:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
To confirm this, I tried compiling by hand the file where the error was generated above after removing from the compile command the part
-isystem /usr/lib/../include
and the file compiled just fine.
I tried to locate where is this compilation directive coming from but couldn't find it in any of the cmake files. But I don't know cmake very well and I have no idea how to debug it.
By the way, if I install gcc version 5 on my system, as expected, nektar compiles.
I will try to compile nektar++ with clang++ to see what happens.
This error will become more common as new versions of gcc start becoming more common (I think newer versions of ubuntu already use gcc 6.x). The quickest fix is to install gcc version 5.
Thanks
Paulo Jabardo _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
participants (3)
- 
                
                David Moxey
- 
                
                Douglas Serson
- 
                
                Paulo Jabardo