Skip to content

Commit

Permalink
supplementing manual build system
Browse files Browse the repository at this point in the history
  • Loading branch information
tyounkin committed Oct 3, 2023
1 parent 0cc5fd8 commit 287f656
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 0 deletions.
73 changes: 73 additions & 0 deletions CMake/FindLibConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Find the CUnit includes and library
#
# This module defines
# LIBCONFIG_INCLUDE_DIR, where to find cppunit include files, etc.
# LIBCONFIG_LIBRARIES, the libraries to link against to use CppUnit.
# LIBCONFIG_STATIC_LIBRARIY_PATH
# LIBCONFIG_FOUND, If false, do not try to use CppUnit.

# also defined, but not for general use are
# LIBCONFIG_LIBRARY, where to find the CUnit library.

#MESSAGE("Searching for libconfig library")

FIND_PATH(LIBCONFIG_INCLUDE_DIR libconfig.h
/usr/local/include
/usr/include
)

FIND_PATH(LIBCONFIGPP_INCLUDE_DIR libconfig.h++
/usr/local/include
/usr/include
)

FIND_LIBRARY(LIBCONFIG_LIBRARY config
/usr/local/lib
/usr/lib
)

FIND_LIBRARY(LIBCONFIGPP_LIBRARY config++
/usr/local/lib
/usr/lib
)

FIND_LIBRARY(LIBCONFIG_STATIC_LIBRARY "libconfig${CMAKE_STATIC_LIBRARY_SUFFIX}"
/usr/local/lib
/usr/lib
)

FIND_LIBRARY(LIBCONFIGPP_STATIC_LIBRARY "libconfig++${CMAKE_STATIC_LIBRARY_SUFFIX}"
/usr/local/lib
/usr/lib
)


IF (LIBCONFIG_INCLUDE_DIR)
IF (LIBCONFIG_LIBRARY)
SET(LIBCONFIG_FOUND TRUE)
SET(LIBCONFIG_LIBRARIES ${LIBCONFIG_LIBRARY})
SET(LIBCONFIG_STATIC_LIBRARY_PATH ${LIBCONFIG_STATIC_LIBRARY})
ENDIF (LIBCONFIG_LIBRARY)
ENDIF (LIBCONFIG_INCLUDE_DIR)

IF (LIBCONFIGPP_INCLUDE_DIR)
IF (LIBCONFIGPP_LIBRARY)
SET(LIBCONFIGPP_FOUND TRUE)
SET(LIBCONFIGPP_LIBRARIES ${LIBCONFIGPP_LIBRARY})
SET(LIBCONFIGPP_STATIC_LIBRARY_PATH ${LIBCONFIGPP_STATIC_LIBRARY})
ENDIF (LIBCONFIGPP_LIBRARY)
ENDIF (LIBCONFIGPP_INCLUDE_DIR)

IF (LIBCONFIG_FOUND)
IF (NOT LibConfig_FIND_QUIETLY)
MESSAGE(STATUS "Found LibConfig++: ${LIBCONFIGPP_LIBRARIES}")
MESSAGE(STATUS "Found LibConfig: ${LIBCONFIG_LIBRARIES}")
MESSAGE(STATUS "static LibConfig path: ${LIBCONFIG_STATIC_LIBRARY_PATH}")
ENDIF (NOT LibConfig_FIND_QUIETLY)
ELSE (LIBCONFIG_FOUND)
IF (LibConfig_FIND_REQUIRED)
MESSAGE(SEND_ERROR "Could NOT find LibConfig")
ENDIF (LibConfig_FIND_REQUIRED)
ENDIF (LIBCONFIG_FOUND)

MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARIES)
2 changes: 2 additions & 0 deletions build/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rm CMakeCache.txt
rm -r CMakeFiles
26 changes: 26 additions & 0 deletions build/make_gitr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
source ../env.default.sh

cmake -DTHRUST_INCLUDE_DIR=$THRUST_DIR \
-DNETCDF_CXX_INCLUDE_DIR=$NETCDFCXX4INCLUDE \
-DNETCDF_CXX_LIBRARY=$NETCDFCXX4LIB \
-DLIBCONFIG_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \
-DLIBCONFIGPP_LIBRARY=$LIBCONFIGLIB \
-DLIBCONFIGPP_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \
-DUSE_CUDA=1 \
-DUSE_MPI=0 \
-DUSE_DOUBLE=1 \
..
# -DNETCDF_CXX_INCLUDE_DIR=$NETCDFCXX4INCLUDE \
# -DNETCDF_CXX_LIBRARY=$NETCDFLIB_CPP \
# -DNETCDF_DIR=$NETCDFDIR \
# -DNETCDF_INCLUDE_DIR=$NETCDFINCLUDE \
# -DNETCDF_LIBRARY=$NETCDFLIB \
# -DLIBCONFIGPP_LIBRARY=$LIBCONFIGLIB \
# -DLIBCONFIGPP_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \
# -DCPPFLAGS=-I${H5DIR}/include \
# -DLDFLAGS=${H5DIR}/lib/libhdf5.dylib \
# -DHDF5_LIBRARIES=${H5DIR}/lib/libhdf5.a \
# -DHDF5_INCLUDE_DIRS=${H5DIR}/include \
# -DHDF5_C_COMPILER_EXECUTABLE=${H5DIR}/bin/h5pcc \
# -DHDF5_HL_LIBRARIES=${H5DIR}/lib/libhdf5_hl.dylib \
7 changes: 7 additions & 0 deletions dependencies/build_all_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export GITR_TOP_LEVEL=~/trash
./build_zlib.sh
./build_m4.sh
./build_hdf5.sh
./build_necdfc.sh
./build_necdfcxx.sh
./build_libconfig.sh
9 changes: 9 additions & 0 deletions dependencies/build_hdf5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.gz
tar -xzvf hdf5-1.12.2.tar.gz
cd hdf5-1.12.2/
mkdir ../hdf5build
./configure --with-zlib=$GITR_TOP_LEVEL/zlibbuild --prefix=$GITR_TOP_LEVEL/hdf5build
make -j
#make check
make install
make check-install
9 changes: 9 additions & 0 deletions dependencies/build_libconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
wget https://github.com/hyperrealm/libconfig/archive/v1.7.2.tar.gz
tar -xvzf v1.7.2.tar.gz
cd libconfig-1.7.2/
mkdir ../libconfigbuild
autoreconf
./configure --prefix=$GITR_TOP_LEVEL/libconfigbuild
make
make check
make install
7 changes: 7 additions & 0 deletions dependencies/build_m4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wget https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz
tar -xzvf m4-1.4.19.tar.gz
cd m4-1.4.19/
mkdir ../m4build
./configure --prefix=$GITR_TOP_LEVEL/m4build
make
make install
10 changes: 10 additions & 0 deletions dependencies/build_necdfc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.7.4.tar.gz
tar -xzvf v4.7.4.tar.gz
cd netcdf-c-4.7.4/
mkdir ../netcdfcbuild
export CPPFLAGS="-I$GITR_TOP_LEVEL/zlibbuild/include -I$GITR_TOP_LEVEL/hdf5build/include"
export LDFLAGS="-L$GITR_TOP_LEVEL/zlibbuild/lib -L$GITR_TOP_LEVEL/hdf5build/lib"
./configure --disable-dap --prefix=$GITR_TOP_LEVEL/netcdfcbuild
make
#make check
make install
11 changes: 11 additions & 0 deletions dependencies/build_necdfcxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
wget https://github.com/Unidata/netcdf-cxx4/archive/refs/tags/v4.3.1.tar.gz
tar -xzvf v4.3.1.tar.gz
cd netcdf-cxx4-4.3.1/
mkdir ../netcdfcxxbuild
export PATH=$PATH:/home/tqd/Code/netcdfcbuild/bin
export LDFLAGS="-L$GITR_TOP_LEVEL/zlibbuild/lib -L$GITR_TOP_LEVEL/hdf5build/lib -L$GITR_TOP_LEVEL/netcdfcbuild/lib"
export CPPFLAGS="-I$GITR_TOP_LEVEL/zlibbuild/include -I$GITR_TOP_LEVEL/hdf5build/include -I$GITR_TOP_LEVEL/netcdfcbuild/include"
./configure --prefix=$GITR_TOP_LEVEL/netcdfcxxbuild
make
#make check
make install
7 changes: 7 additions & 0 deletions dependencies/build_zlib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wget http://zlib.net/zlib-1.2.13.tar.gz
tar -xzvf zlib-1.2.13.tar.gz
cd zlib-1.2.13
mkdir ../zlibbuild
./configure --prefix=$GITR_TOP_LEVEL/zlibbuild
make
make install
18 changes: 18 additions & 0 deletions dependencies/clean_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rm -r zlib-1.2.13
rm zlib-1.2.13.tar.gz
rm -r zlibbuild
rm hdf5-1.12.2.tar.gz
rm -r hdf5-1.12.2
rm -r hdf5build
rm v4.7.4.tar.gz
rm -r netcdf-c-4.7.4
rm -r netcdfcbuild
rm -r netcdfcxxbuild
rm -r netcdf-cxx4-4.3.1
rm v4.3.1.tar.gz
rm m4-1.4.19.tar.gz
rm -r m4-1.4.19
rm -r m4build
rm v1.7.2.tar.gz
rm -r libconfig-1.7.2
rm -r libconfigbuild
27 changes: 27 additions & 0 deletions env.default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export GITR_TOP_LEVEL=~/trash
#export TQD_HOME=/home/tqd
#export PATH=/home/tqd/Code/cmakebuild/bin:$PATH:$TQD_HOME/Code/pythonbuild/bin:$TQD_HOME/Code/openmpiBuild/bin:/home/tqd/Code/llvm-project/build/bin
#export CMAKE_SOURCE_DIR=../
#export NETCDF=$TQD_HOME/Code/netcdfcbuild
export NETCDFCXX4=$GITR_TOP_LEVEL/netcdfcxxbuild
#export NETCDFDIR=$NETCDF/lib
#export NETCDFCXX4DIR=$NETCDFCXX4/lib
#export NETCDFINCLUDE=$NETCDF/include
export NETCDFCXX4INCLUDE=$NETCDFCXX4/include
export NETCDFCXX4LIB=$NETCDFCXX4/lib/libnetcdf_c++4.so
#export NETCDFLIB=$NETCDFDIR/libnetcdf.so
#export NETCDFLIB_CPP=$NETCDFCXX4DIR/libnetcdf_c++4.so
#export PATH=$PATH:/$NETCDF/bin
#
export LIBCONFIGDIR=$GITR_TOP_LEVEL/libconfigbuild
export LIBCONFIGLIB=$LIBCONFIGDIR/lib/libconfig++.so
#export LIBCONFIGPP_LIBRARIES=lconfig++
#export LIBCONFIGPP_LIBRARY=lconfig++
#export LIBCONFIGPP_STATIC_LIBRARY=
export LIBCONFIG_INCLUDE_DIR=$LIBCONFIGDIR/include
#export LIBCONFIGPP_INCLUDE_DIR=$LIBCONFIGDIR/include
#export LIBCONFIG_LIBRARY=lconfig
#export THRUST_INCLUDE_DIRS=$TQD_HOME/Code/thrust
#export THRUST_INCLUDE_DIR=$TQD_HOME/Code/thrust
export THRUST_DIR=$GITR_TOP_LEVEL/thrust
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib:$NETCDFCXX4/lib:$TQD_HOME/Code/openmpiBuild/lib

0 comments on commit 287f656

Please sign in to comment.