sandialabs / seacas

The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Other
132 stars 79 forks source link

Vanilla `install-tpl.sh` execution fails on FreeBSD and OpenBSD #418

Open seanm opened 10 months ago

seanm commented 10 months ago

Running nstall-tpl.sh fails because it assumes gcc exists.

Setting COMPILER=cc gets past this, but it would be a nice touch if it could default to plain cc instead of gcc.

Full output:

kartikeya$ bash ./install-tpl.sh
/home/builder/external/seacas
+++ HDF5
+++ Downloading...
--2023-11-08 19:22:01--  https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.3/src/hdf5-1.14.3.tar.bz2
Resolving support.hdfgroup.org (support.hdfgroup.org)... 50.28.50.143
Connecting to support.hdfgroup.org (support.hdfgroup.org)|50.28.50.143|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16320137 (16M) [application/x-tar]
Saving to: 'hdf5-1.14.3.tar.bz2'

hdf5-1.14.3.tar.bz2           100%[=================================================>]  15.56M  1.48MB/s    in 11s

2023-11-08 19:22:12 (1.45 MB/s) - 'hdf5-1.14.3.tar.bz2' saved [16320137/16320137]

+++ Configuring, Building, and Installing...
+ '[' X/home/builder/external/seacas == X ']'
+ INSTALL_PATH=/home/builder/external/seacas
+ DEBUG=NO
+ '[' NO == YES ']'
+ BUILD_TYPE=Release
+ '[' NO == YES ']'
+ SHARED=YES
+ [[ YES == \O\N ]]
+ [[ YES == \Y\E\S ]]
++ uname -s
+ OS=OpenBSD
+ '[' OpenBSD = Darwin ']'
+ LD_EXT=so
+ NEEDS_ZLIB=NO
+ '[' NO == YES ']'
+ '[' NO == ON ']'
+ NEEDS_SZIP=NO
+ '[' NO == YES ']'
+ '[' NO == ON ']'
+ . /home/builder/external/seacas/TPL/compiler.sh
++ COMPILER=gnu
++ MPI=NO
++ '[' gnu == mpi ']'
++ '[' NO == YES ']'
++ '[' NO == YES ']'
++ '[' gnu == gnu ']'
++ export CC=gcc
++ CC=gcc
++ export CXX=g++
++ CXX=g++
++ '[' gnu == clang ']'
++ '[' gnu == gnubrew ']'
++ '[' gnu == gnumacport ']'
++ '[' gnu == clangmacport ']'
++ '[' gnu == intel ']'
++ '[' gnu == analyzer ']'
++ '[' gnu == ibm ']'
++ '[' gnu == nvidia ']'
+ rm -f config.cache
+ cmake .. -DCMAKE_C_COMPILER:FILEPATH=gcc -DBUILD_SHARED_LIBS:BOOL=YES -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=/home/builder/external/seacas -DCMAKE_BUILD_TYPE=Release -DDEFAULT_API_VERSION=V18 -DHDF5_ENABLE_PARALLEL:BOOL=NO -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DHDF5_BUILD_CPP_LIB:BOOL=NO -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_DISABLE_COMPILER_WARNINGS:BOOL=ON
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_C_COMPILER:

    gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
+ echo ''

+ echo '         MPI: NO'
         MPI: NO
+ echo '    COMPILER: gcc'
    COMPILER: gcc
+ echo '      ACCESS: /home/builder/external/seacas'
      ACCESS: /home/builder/external/seacas
+ echo 'INSTALL_PATH: /home/builder/external/seacas'
INSTALL_PATH: /home/builder/external/seacas
+ echo ''

make: no target to make.
couldn't build hdf5. exiting.
gsjaardema commented 10 months ago

I understand the desire for this, but I think the primary reason for defaulting to gcc or gnu is that we then know that typically a fortran compiler will exist and I know that it will be gfortran. In the cc, cxx case, there is no default or reasonable fortran compiler to try. The build would make it past the C compiler and C++ compiler tests, but then fail on the fortran compiler test...

seanm commented 10 months ago

Couldn't default compilers be specified per-language?