From ec3effb97a0ba6973af287b0804b6bed74917373 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Tue, 6 Oct 2020 16:18:28 -0500 Subject: [PATCH 01/21] first try at proprocessing from plugin --- README.md | 2 +- export_dagmc_cmd/DAGMCExportCommand.cpp | 41 ++++++++++++++++++++++++- export_dagmc_cmd/DAGMCExportCommand.hpp | 5 ++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d82a73b2c..712d021c5 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ cd DAGMC git clone https://github.com/svalinn/DAGMC -b develop cd bld cmake ../DAGMC -DMOAB_DIR=${HOME}/plugin-build/moab \ - -DBUILD_UWUW=OFF \ + -DBUILD_UWUW=ON \ -DBUILD_TALLY=OFF \ -DBUILD_BUILD_OBB=OFF \ -DBUILD_MAKE_WATERTIGHT=ON \ diff --git a/export_dagmc_cmd/DAGMCExportCommand.cpp b/export_dagmc_cmd/DAGMCExportCommand.cpp index 5907c6493..fd1ae405a 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.cpp +++ b/export_dagmc_cmd/DAGMCExportCommand.cpp @@ -25,6 +25,9 @@ #include "moab/Interface.hpp" #include "moab/GeomTopoTool.hpp" +// DAGMC includes +#include "uwuw_preprocessor.hpp" + #define CHK_MB_ERR_RET(A,B) if (moab::MB_SUCCESS != (B)) { \ message << (A) << (B) << std::endl; \ CubitInterface::get_cubit_message_handler()->print_message(message.str().c_str()); \ @@ -46,6 +49,9 @@ DAGMCExportCommand::DAGMCExportCommand() : verbose_warnings = false; fatal_on_curves = false; + pyne_mat_lib = ""; + hdf5_path = "/materials"; + CubitMessageHandler *console = CubitInterface::get_cubit_message_handler(); if (console) { std::ostringstream load_message; @@ -70,6 +76,8 @@ std::vector DAGMCExportCommand::get_syntax() "[length_tolerance '>] " "[normal_tolerance '>] " "[make_watertight]" + "[pyne_mat_lib '>]" + "[hdf5_path '>]" "[verbose] [fatal_on_curves]"; std::vector syntax_list; @@ -159,6 +167,24 @@ bool DAGMCExportCommand::execute(CubitCommandData &data) rval = teardown(); CHK_MB_ERR_RET("Error tearing down export command.",rval); + // if a PyNE material library is provided then try to process the mats + if(pyne_mat_lib != "") { + bool fatal_errors = false; + + uwuw_preprocessor* uwuw_preproc = new uwuw_preprocessor(pyne_mat_lib, filename, filename, hdf5_path, verbose_warnings, fatal_errors); + // process the materials + uwuw_preproc->process_materials(); + + // process the tallies + uwuw_preproc->process_tallies(); + + // write the material data + uwuw_preproc->write_uwuw_materials(); + + // write the tally data + uwuw_preproc->write_uwuw_tallies(); + } + return result; } @@ -191,7 +217,20 @@ moab::ErrorCode DAGMCExportCommand::parse_options(CubitCommandData &data, moab:: verbose_warnings = data.find_keyword("verbose"); fatal_on_curves = data.find_keyword("fatal_on_curves"); make_watertight = data.find_keyword("make_watertight"); - + + // read parsed command for normal tolerance + data.get_string("pyne_mat_lib", pyne_mat_lib); + if (pyne_mat_lib != "") { + message << "Looking for the PyNE material Lib in " << pyne_mat_lib << std::endl; + data.get_string("hdf5_path",hdf5_path); + message << "hdf5 path set to " << hdf5_path << std::endl; + } + else { + message + << "No Material Library set, material assignments will not be processed" + << std::endl; + } + if (verbose_warnings && fatal_on_curves) message << "This export will fail if curves fail to facet" << std::endl; diff --git a/export_dagmc_cmd/DAGMCExportCommand.hpp b/export_dagmc_cmd/DAGMCExportCommand.hpp index 29ce1e636..ebbc625f7 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.hpp +++ b/export_dagmc_cmd/DAGMCExportCommand.hpp @@ -70,7 +70,10 @@ class DAGMCExportCommand: public CubitCommand bool verbose_warnings; bool fatal_on_curves; bool make_watertight; - + std::string pyne_mat_lib; + std::string hdf5_path; + + int failed_curve_count; std::vector failed_curves; From 55a2f7c3264a75ec8a04b906a43a9d8741b6b5fc Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Tue, 6 Oct 2020 16:18:28 -0500 Subject: [PATCH 02/21] first try at proprocessing from plugin --- README.md | 2 +- export_dagmc_cmd/DAGMCExportCommand.cpp | 41 ++++++++++++++++++++++++- export_dagmc_cmd/DAGMCExportCommand.hpp | 5 ++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23856306a..e12955017 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ cd DAGMC git clone https://github.com/svalinn/DAGMC -b develop cd bld cmake ../DAGMC -DMOAB_DIR=${HOME}/plugin-build/moab \ - -DBUILD_UWUW=OFF \ + -DBUILD_UWUW=ON \ -DBUILD_TALLY=OFF \ -DBUILD_BUILD_OBB=OFF \ -DBUILD_MAKE_WATERTIGHT=ON \ diff --git a/export_dagmc_cmd/DAGMCExportCommand.cpp b/export_dagmc_cmd/DAGMCExportCommand.cpp index 5907c6493..fd1ae405a 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.cpp +++ b/export_dagmc_cmd/DAGMCExportCommand.cpp @@ -25,6 +25,9 @@ #include "moab/Interface.hpp" #include "moab/GeomTopoTool.hpp" +// DAGMC includes +#include "uwuw_preprocessor.hpp" + #define CHK_MB_ERR_RET(A,B) if (moab::MB_SUCCESS != (B)) { \ message << (A) << (B) << std::endl; \ CubitInterface::get_cubit_message_handler()->print_message(message.str().c_str()); \ @@ -46,6 +49,9 @@ DAGMCExportCommand::DAGMCExportCommand() : verbose_warnings = false; fatal_on_curves = false; + pyne_mat_lib = ""; + hdf5_path = "/materials"; + CubitMessageHandler *console = CubitInterface::get_cubit_message_handler(); if (console) { std::ostringstream load_message; @@ -70,6 +76,8 @@ std::vector DAGMCExportCommand::get_syntax() "[length_tolerance '>] " "[normal_tolerance '>] " "[make_watertight]" + "[pyne_mat_lib '>]" + "[hdf5_path '>]" "[verbose] [fatal_on_curves]"; std::vector syntax_list; @@ -159,6 +167,24 @@ bool DAGMCExportCommand::execute(CubitCommandData &data) rval = teardown(); CHK_MB_ERR_RET("Error tearing down export command.",rval); + // if a PyNE material library is provided then try to process the mats + if(pyne_mat_lib != "") { + bool fatal_errors = false; + + uwuw_preprocessor* uwuw_preproc = new uwuw_preprocessor(pyne_mat_lib, filename, filename, hdf5_path, verbose_warnings, fatal_errors); + // process the materials + uwuw_preproc->process_materials(); + + // process the tallies + uwuw_preproc->process_tallies(); + + // write the material data + uwuw_preproc->write_uwuw_materials(); + + // write the tally data + uwuw_preproc->write_uwuw_tallies(); + } + return result; } @@ -191,7 +217,20 @@ moab::ErrorCode DAGMCExportCommand::parse_options(CubitCommandData &data, moab:: verbose_warnings = data.find_keyword("verbose"); fatal_on_curves = data.find_keyword("fatal_on_curves"); make_watertight = data.find_keyword("make_watertight"); - + + // read parsed command for normal tolerance + data.get_string("pyne_mat_lib", pyne_mat_lib); + if (pyne_mat_lib != "") { + message << "Looking for the PyNE material Lib in " << pyne_mat_lib << std::endl; + data.get_string("hdf5_path",hdf5_path); + message << "hdf5 path set to " << hdf5_path << std::endl; + } + else { + message + << "No Material Library set, material assignments will not be processed" + << std::endl; + } + if (verbose_warnings && fatal_on_curves) message << "This export will fail if curves fail to facet" << std::endl; diff --git a/export_dagmc_cmd/DAGMCExportCommand.hpp b/export_dagmc_cmd/DAGMCExportCommand.hpp index 29ce1e636..ebbc625f7 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.hpp +++ b/export_dagmc_cmd/DAGMCExportCommand.hpp @@ -70,7 +70,10 @@ class DAGMCExportCommand: public CubitCommand bool verbose_warnings; bool fatal_on_curves; bool make_watertight; - + std::string pyne_mat_lib; + std::string hdf5_path; + + int failed_curve_count; std::vector failed_curves; From ffcdfacb6c8f9ccec1f145da1d9cf30e8d30b6bd Mon Sep 17 00:00:00 2001 From: Lucas John Jacobson Date: Wed, 7 Oct 2020 16:38:36 -0500 Subject: [PATCH 03/21] Add pyne_dagmc and uwuw to tarball --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e12955017..f5618eeb5 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,8 @@ cp -pPv ${HOME}/plugin-build/lib/* . cp -pPv ${HOME}/plugin-build/moab/lib/libMOAB.so* . cp -pPv ${HOME}/plugin-build/DAGMC/lib/libdagmc.so* . cp -pPv ${HOME}/plugin-build/DAGMC/lib/libmakeWatertight.so* . +cp -pPv ${HOME}/plugin-build/DAGMC/lib/libpyne_dagmc.so . +cp -pPv ${HOME}/plugin-build/DAGMC/lib/libuwuw.so . cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . chmod 644 * @@ -181,6 +183,8 @@ chmod 644 * patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libMOAB.so patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libdagmc.so patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libmakeWatertight.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libpyne_dagmc.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libuwuw.so # Create the Svalinn plugin tarball cd .. From 5e3632ed42f60d65b8e177ac5d8731ec947b0f13 Mon Sep 17 00:00:00 2001 From: Lucas John Jacobson Date: Wed, 7 Oct 2020 16:39:01 -0500 Subject: [PATCH 04/21] Build moab and DAGMC with _GLIBCXX_USE_CXX11_ABI=0 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5618eeb5..33abe583d 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,8 @@ cd ../bld --disable-blaslapack \ --with-eigen3=/usr/include/eigen3 \ --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial \ - --prefix=${HOME}/plugin-build/moab + --prefix=${HOME}/plugin-build/moab \ + CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 make -j`grep -c processor /proc/cpuinfo` make install ``` @@ -107,7 +108,8 @@ mkdir -pv DAGMC/bld cd DAGMC git clone https://github.com/svalinn/DAGMC -b develop cd bld -cmake ../DAGMC -DMOAB_DIR=${HOME}/plugin-build/moab \ +cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + -DMOAB_DIR=${HOME}/plugin-build/moab \ -DBUILD_UWUW=ON \ -DBUILD_TALLY=OFF \ -DBUILD_BUILD_OBB=OFF \ From 488273de60030d98a02e921a2857c7dabc2ae223 Mon Sep 17 00:00:00 2001 From: Lucas John Jacobson Date: Thu, 8 Oct 2020 11:26:16 -0500 Subject: [PATCH 05/21] Add TRELIS_VERSION cmake variable --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed46a5e13..609b2c4fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,15 +24,18 @@ endif () set(CMAKE_CXX_STANDARD 11) # Adjust compiler setting for Linux using gcc version 5.0 and higher -if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0") - if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI) - set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}") - endif () - endif () -endif () +#if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX) +# if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0") +# if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI) +# set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}") +# endif () +# endif () +#endif () # Find Cubit/Trelis +if (NOT CUBIT_ROOT) + set(CUBIT_ROOT "/opt/Trelis-${TRELIS_VERSION}") +endif () list(APPEND CMAKE_PREFIX_PATH ${CUBIT_ROOT}/bin) find_package(Cubit REQUIRED CONFIG) include_directories(${CUBIT_INCLUDE_DIRS}) From 6b073d51f47201f62d56aacd86053d5cce5ea67b Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 9 Oct 2020 15:11:52 -0500 Subject: [PATCH 06/21] removing some unrelated change, rearanging CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 order for consistency --- CMakeLists.txt | 18 ++++++++---------- README.md | 6 +++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 609b2c4fb..64a2d0770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,18 +24,16 @@ endif () set(CMAKE_CXX_STANDARD 11) # Adjust compiler setting for Linux using gcc version 5.0 and higher -#if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX) -# if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0") -# if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI) -# set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}") -# endif () -# endif () -#endif () +if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0") + if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI) + set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}") + endif () + endif () +endif () # Find Cubit/Trelis -if (NOT CUBIT_ROOT) - set(CUBIT_ROOT "/opt/Trelis-${TRELIS_VERSION}") -endif () + list(APPEND CMAKE_PREFIX_PATH ${CUBIT_ROOT}/bin) find_package(Cubit REQUIRED CONFIG) include_directories(${CUBIT_INCLUDE_DIRS}) diff --git a/README.md b/README.md index 33abe583d..d2c2b37a7 100644 --- a/README.md +++ b/README.md @@ -83,15 +83,15 @@ git clone https://bitbucket.org/fathomteam/moab -b Version5.1.0 cd moab autoreconf -fi cd ../bld -../moab/configure --disable-blaslapack \ +../moab/configure CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + --disable-blaslapack \ --enable-shared \ --enable-optimize \ --disable-debug \ --disable-blaslapack \ --with-eigen3=/usr/include/eigen3 \ --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial \ - --prefix=${HOME}/plugin-build/moab \ - CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 + --prefix=${HOME}/plugin-build/moab make -j`grep -c processor /proc/cpuinfo` make install ``` From d41fe4de6cccc87e28074c6443f0da99e4b68f30 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 9 Oct 2020 15:31:52 -0500 Subject: [PATCH 07/21] One Script to link them all, one script to find them; one script to build them and in the plugin bind them. --- buid_plugin.sh | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 buid_plugin.sh diff --git a/buid_plugin.sh b/buid_plugin.sh new file mode 100755 index 000000000..aee76322a --- /dev/null +++ b/buid_plugin.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +# Setup +CURRENT=$(pwd) +SCRIPTPATH=`dirname $(realpath $0)` + +PLUGIN_DIR="plugin-build" + +mkdir ${PLUGIN_DIR} +PLUGIN_ABS_PATH=${CURRENT}/${PLUGIN_DIR} + +echo "Building the Trelis plugin in ${CURRENT}\\${PLUGIN_DIR}" + +unset LD_LIBRARY_PATH + +cd ${PLUGIN_ABS_PATH} +ln -s $SCRIPTPATH ./ + +mkdir -pv moab/bld +cd moab +git clone https://bitbucket.org/fathomteam/moab -b Version5.1.0 +cd moab +autoreconf -fi +cd ../bld +../moab/configure CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + --disable-blaslapack \ + --enable-shared \ + --enable-optimize \ + --disable-debug \ + --disable-blaslapack \ + --with-eigen3=/usr/include/eigen3 \ + --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial \ + --prefix=${PLUGIN_ABS_PATH}/moab +make -j`grep -c processor /proc/cpuinfo` +make install + +cd ${PLUGIN_ABS_PATH} +mkdir -pv DAGMC/bld +cd DAGMC +git clone https://github.com/svalinn/DAGMC -b develop +cd bld +cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + -DMOAB_DIR=${PLUGIN_ABS_PATH}/moab \ + -DBUILD_UWUW=ON \ + -DBUILD_TALLY=OFF \ + -DBUILD_BUILD_OBB=OFF \ + -DBUILD_MAKE_WATERTIGHT=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH}/DAGMC +make -j`grep -c processor /proc/cpuinfo` +make install + +cd ${PLUGIN_ABS_PATH} +mkdir -pv bld +cd bld +cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-16.5 \ + -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} +make -j`grep -c processor /proc/cpuinfo` +make install + +cd ${PLUGIN_ABS_PATH}/Trelis-plugin +git submodule update --init + +cd ${PLUGIN_ABS_PATH} +mkdir -p pack/bin/plugins/svalinn +cd pack/bin/plugins/svalinn + +# Copy all needed libraries into current directory +cp -pPv ${PLUGIN_ABS_PATH}/lib/* . +cp -pPv ${PLUGIN_ABS_PATH}/moab/lib/libMOAB.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libdagmc.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libmakeWatertight.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libpyne_dagmc.so . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libuwuw.so . +cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . +chmod 644 * + +# Set the RPATH to be the current directory for the DAGMC libraries +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libMOAB.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libdagmc.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libmakeWatertight.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libpyne_dagmc.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libuwuw.so + +# Create the Svalinn plugin tarball +cd .. +ln -sv svalinn/libsvalinn_plugin.so . +cd ../.. +tar --sort=name -czvf svalinn-plugin.tgz bin +mv -v svalinn-plugin.tgz .. +cd .. +rm -rf pack bld DAGMC lib moab +rm Trelis-plugin \ No newline at end of file From d67a9a830c94facbeef766909dbda5a3e86cb675 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Thu, 15 Oct 2020 08:14:43 -0500 Subject: [PATCH 08/21] removing empty line --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e094d55a5..1fd7d91f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX) endif () # Find Cubit/Trelis - if (NOT CUBIT_ROOT) message(FATAL_ERROR "CUBIT_ROOT not specified") endif () From 51da7434561eb2fc4b33e4895055b2096c39b43b Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 10:48:39 -0500 Subject: [PATCH 09/21] apt-get required package --- buid_plugin.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buid_plugin.sh b/buid_plugin.sh index aee76322a..85c0ae654 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -1,5 +1,7 @@ #!/bin/bash +sudo apt-gen install autogen autoconf libtool + # Setup CURRENT=$(pwd) SCRIPTPATH=`dirname $(realpath $0)` From d848f46195375a55c3a150ff2b71d2456fc790f8 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 10:49:04 -0500 Subject: [PATCH 10/21] more apt-get --- buid_plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index 85c0ae654..62dfcf6f0 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -1,6 +1,6 @@ #!/bin/bash -sudo apt-gen install autogen autoconf libtool +sudo apt-gen install autogen autoconf libtool libeigen3-dev libhdf5-dev # Setup CURRENT=$(pwd) From 22f453186c6279cb2c3c3032d8eb9b4d7307ef49 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 11:29:40 -0500 Subject: [PATCH 11/21] fixing typo --- buid_plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index 62dfcf6f0..c526c6b20 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -1,6 +1,6 @@ #!/bin/bash -sudo apt-gen install autogen autoconf libtool libeigen3-dev libhdf5-dev +sudo apt-get install autogen autoconf libtool libeigen3-dev libhdf5-dev # Setup CURRENT=$(pwd) From 5bf044f440efa200d8a2afcbab462cd8128916c9 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 11:38:17 -0500 Subject: [PATCH 12/21] adding more package --- buid_plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index c526c6b20..fae15c1c8 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -1,6 +1,6 @@ #!/bin/bash -sudo apt-get install autogen autoconf libtool libeigen3-dev libhdf5-dev +sudo apt-get install autogen autoconf libtool libeigen3-dev libhdf5-dev patchelf gfortran # Setup CURRENT=$(pwd) From e376152f6ab7a063212f8180e48770775d6d2bb0 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 13:31:31 -0500 Subject: [PATCH 13/21] update script to 17.1 --- buid_plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index fae15c1c8..fbf41fe44 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -57,7 +57,7 @@ make install cd ${PLUGIN_ABS_PATH} mkdir -pv bld cd bld -cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-16.5 \ +cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-17.1 \ -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} From 8f62d58d01dea64883dc9caefb1f4014435382f1 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 14:20:56 -0500 Subject: [PATCH 14/21] no removeing --- buid_plugin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index fbf41fe44..c4dafa501 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -95,5 +95,5 @@ cd ../.. tar --sort=name -czvf svalinn-plugin.tgz bin mv -v svalinn-plugin.tgz .. cd .. -rm -rf pack bld DAGMC lib moab -rm Trelis-plugin \ No newline at end of file +#rm -rf pack bld DAGMC lib moab +#rm Trelis-plugin \ No newline at end of file From 9d28f928be6d57df19cd5a61ccc5525222883b40 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 14:21:45 -0500 Subject: [PATCH 15/21] reordering --- buid_plugin.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index c4dafa501..55f645bb9 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -54,6 +54,10 @@ cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ make -j`grep -c processor /proc/cpuinfo` make install + +cd ${PLUGIN_ABS_PATH}/Trelis-plugin +git submodule update --init + cd ${PLUGIN_ABS_PATH} mkdir -pv bld cd bld @@ -64,8 +68,6 @@ cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-17.1 \ make -j`grep -c processor /proc/cpuinfo` make install -cd ${PLUGIN_ABS_PATH}/Trelis-plugin -git submodule update --init cd ${PLUGIN_ABS_PATH} mkdir -p pack/bin/plugins/svalinn From 06fa6cdda994afc861608d39563cc46fe66b301c Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 16 Oct 2020 14:35:58 -0500 Subject: [PATCH 16/21] restauring cleanup --- buid_plugin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buid_plugin.sh b/buid_plugin.sh index 55f645bb9..98037a597 100755 --- a/buid_plugin.sh +++ b/buid_plugin.sh @@ -97,5 +97,5 @@ cd ../.. tar --sort=name -czvf svalinn-plugin.tgz bin mv -v svalinn-plugin.tgz .. cd .. -#rm -rf pack bld DAGMC lib moab -#rm Trelis-plugin \ No newline at end of file +rm -rf pack bld DAGMC lib moab +rm Trelis-plugin \ No newline at end of file From e8ee71cd6d4117c22a5bf744ed5a53e8505ca5cf Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Mon, 26 Oct 2020 11:01:13 -0500 Subject: [PATCH 17/21] some cleaning --- script/build_plug_linux.sh | 4 ++ script/build_plugin.sh | 110 +++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100755 script/build_plug_linux.sh create mode 100755 script/build_plugin.sh diff --git a/script/build_plug_linux.sh b/script/build_plug_linux.sh new file mode 100755 index 000000000..b2aac02e2 --- /dev/null +++ b/script/build_plug_linux.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +SCRIPTPATH=`dirname $(dirname $(realpath $0))` +docker run -v "$SCRIPTPATH:/Trelis-plugin" -v "$2:/Trelis-sdk" -it $1 bash -c "/Trelis-plugin/script/build_plugin.sh $3" \ No newline at end of file diff --git a/script/build_plugin.sh b/script/build_plugin.sh new file mode 100755 index 000000000..c4cc2a56c --- /dev/null +++ b/script/build_plugin.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +cd /Trelis-sdk +dpkg -i Trelis-$1-Lin64.deb + +cd /opt +tar -xzvf /Trelis-sdk/Trelis-SDK-$1-Lin64.tar.gz + +apt-get update -y +apt-get install -y autogen autoconf libtool libeigen3-dev libhdf5-dev patchelf gfortran git cmake + +cd + +# Setup +CURRENT=$(pwd) +SCRIPTPATH=`dirname $(dirname $(realpath $0))` + +PLUGIN_DIR="plugin-build" + +mkdir ${PLUGIN_DIR} +PLUGIN_ABS_PATH=${CURRENT}/${PLUGIN_DIR} + +echo "Building the Trelis plugin in ${CURRENT}\\${PLUGIN_DIR}" + +unset LD_LIBRARY_PATH + +cd ${PLUGIN_ABS_PATH} +ln -s $SCRIPTPATH/ ./ + +mkdir -pv moab/bld +cd moab +git clone https://bitbucket.org/fathomteam/moab -b Version5.1.0 +cd moab +autoreconf -fi +cd ../bld +../moab/configure CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + --disable-blaslapack \ + --enable-shared \ + --enable-optimize \ + --disable-debug \ + --disable-blaslapack \ + --with-eigen3=/usr/include/eigen3 \ + --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial \ + --prefix=${PLUGIN_ABS_PATH}/moab +make -j`grep -c processor /proc/cpuinfo` +make install + +cd ${PLUGIN_ABS_PATH} +mkdir -pv DAGMC/bld +cd DAGMC +git clone https://github.com/svalinn/DAGMC -b develop +cd bld +cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ + -DMOAB_DIR=${PLUGIN_ABS_PATH}/moab \ + -DBUILD_UWUW=ON \ + -DBUILD_TALLY=OFF \ + -DBUILD_BUILD_OBB=OFF \ + -DBUILD_MAKE_WATERTIGHT=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH}/DAGMC +make -j`grep -c processor /proc/cpuinfo` +make install + + +cd ${PLUGIN_ABS_PATH}/Trelis-plugin +git submodule update --init + +cd ${PLUGIN_ABS_PATH} +mkdir -pv bld +cd bld +cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-17.1 \ + -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} +make -j`grep -c processor /proc/cpuinfo` +make install + + +cd ${PLUGIN_ABS_PATH} +mkdir -p pack/bin/plugins/svalinn +cd pack/bin/plugins/svalinn + +# Copy all needed libraries into current directory +cp -pPv ${PLUGIN_ABS_PATH}/lib/* . +cp -pPv ${PLUGIN_ABS_PATH}/moab/lib/libMOAB.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libdagmc.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libmakeWatertight.so* . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libpyne_dagmc.so . +cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libuwuw.so . +cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . +chmod 644 * + +# Set the RPATH to be the current directory for the DAGMC libraries +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libMOAB.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libdagmc.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libmakeWatertight.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libpyne_dagmc.so +patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libuwuw.so + +# Create the Svalinn plugin tarball +cd .. +ln -sv svalinn/libsvalinn_plugin.so . +cd ../.. +tar --sort=name -czvf svalinn-plugin_linux_$1.tgz bin +mv -v svalinn-plugin_linux_$1.tgz /Trelis-sdk +cd .. +rm -rf pack bld DAGMC lib moab +rm Trelis-plugin From cfc769e2ca7a36c12c2085818d654106fe63c625 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Mon, 26 Oct 2020 11:01:38 -0500 Subject: [PATCH 18/21] cleaning again --- script/build_plugin.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/script/build_plugin.sh b/script/build_plugin.sh index c4cc2a56c..43ab86dd4 100755 --- a/script/build_plugin.sh +++ b/script/build_plugin.sh @@ -93,11 +93,12 @@ cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . chmod 644 * # Set the RPATH to be the current directory for the DAGMC libraries -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libMOAB.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libdagmc.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libmakeWatertight.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libpyne_dagmc.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libuwuw.so +patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libMOAB.so +patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libdagmc.so +patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libmakeWatertight.so +patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libpyne_dagmc.so +#patchelf --set-rpath /opt/Trelis-$1/bin/plugins libsvalinn_plugin.so +patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libuwuw.so # Create the Svalinn plugin tarball cd .. From a13f40b47822f585f61ed7b983110c00e5f4987b Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Mon, 26 Oct 2020 11:01:53 -0500 Subject: [PATCH 19/21] cleaning --- buid_plugin.sh | 101 ------------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100755 buid_plugin.sh diff --git a/buid_plugin.sh b/buid_plugin.sh deleted file mode 100755 index 98037a597..000000000 --- a/buid_plugin.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash - -sudo apt-get install autogen autoconf libtool libeigen3-dev libhdf5-dev patchelf gfortran - -# Setup -CURRENT=$(pwd) -SCRIPTPATH=`dirname $(realpath $0)` - -PLUGIN_DIR="plugin-build" - -mkdir ${PLUGIN_DIR} -PLUGIN_ABS_PATH=${CURRENT}/${PLUGIN_DIR} - -echo "Building the Trelis plugin in ${CURRENT}\\${PLUGIN_DIR}" - -unset LD_LIBRARY_PATH - -cd ${PLUGIN_ABS_PATH} -ln -s $SCRIPTPATH ./ - -mkdir -pv moab/bld -cd moab -git clone https://bitbucket.org/fathomteam/moab -b Version5.1.0 -cd moab -autoreconf -fi -cd ../bld -../moab/configure CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ - --disable-blaslapack \ - --enable-shared \ - --enable-optimize \ - --disable-debug \ - --disable-blaslapack \ - --with-eigen3=/usr/include/eigen3 \ - --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial \ - --prefix=${PLUGIN_ABS_PATH}/moab -make -j`grep -c processor /proc/cpuinfo` -make install - -cd ${PLUGIN_ABS_PATH} -mkdir -pv DAGMC/bld -cd DAGMC -git clone https://github.com/svalinn/DAGMC -b develop -cd bld -cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ - -DMOAB_DIR=${PLUGIN_ABS_PATH}/moab \ - -DBUILD_UWUW=ON \ - -DBUILD_TALLY=OFF \ - -DBUILD_BUILD_OBB=OFF \ - -DBUILD_MAKE_WATERTIGHT=ON \ - -DBUILD_SHARED_LIBS=ON \ - -DBUILD_STATIC_LIBS=OFF \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH}/DAGMC -make -j`grep -c processor /proc/cpuinfo` -make install - - -cd ${PLUGIN_ABS_PATH}/Trelis-plugin -git submodule update --init - -cd ${PLUGIN_ABS_PATH} -mkdir -pv bld -cd bld -cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-17.1 \ - -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} -make -j`grep -c processor /proc/cpuinfo` -make install - - -cd ${PLUGIN_ABS_PATH} -mkdir -p pack/bin/plugins/svalinn -cd pack/bin/plugins/svalinn - -# Copy all needed libraries into current directory -cp -pPv ${PLUGIN_ABS_PATH}/lib/* . -cp -pPv ${PLUGIN_ABS_PATH}/moab/lib/libMOAB.so* . -cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libdagmc.so* . -cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libmakeWatertight.so* . -cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libpyne_dagmc.so . -cp -pPv ${PLUGIN_ABS_PATH}/DAGMC/lib/libuwuw.so . -cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . -chmod 644 * - -# Set the RPATH to be the current directory for the DAGMC libraries -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libMOAB.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libdagmc.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libmakeWatertight.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libpyne_dagmc.so -patchelf --set-rpath /opt/Trelis-16.5/bin/plugins/svalinn libuwuw.so - -# Create the Svalinn plugin tarball -cd .. -ln -sv svalinn/libsvalinn_plugin.so . -cd ../.. -tar --sort=name -czvf svalinn-plugin.tgz bin -mv -v svalinn-plugin.tgz .. -cd .. -rm -rf pack bld DAGMC lib moab -rm Trelis-plugin \ No newline at end of file From e23560b272e74cbb2e33cb476056821f8fd252e4 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Wed, 28 Oct 2020 14:37:27 -0500 Subject: [PATCH 20/21] some update --- export_dagmc_cmd/DAGMCExportCommand.cpp | 26 +++++++++++++++++++------ export_dagmc_cmd/DAGMCExportCommand.hpp | 1 + script/build_plugin.sh | 5 ++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/export_dagmc_cmd/DAGMCExportCommand.cpp b/export_dagmc_cmd/DAGMCExportCommand.cpp index fd1ae405a..99f89ddfb 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.cpp +++ b/export_dagmc_cmd/DAGMCExportCommand.cpp @@ -164,27 +164,34 @@ bool DAGMCExportCommand::execute(CubitCommandData &data) rval = mdbImpl->write_file(filename.c_str()); CHK_MB_ERR_RET("Error writing file: ",rval); - rval = teardown(); - CHK_MB_ERR_RET("Error tearing down export command.",rval); - + // if a PyNE material library is provided then try to process the mats if(pyne_mat_lib != "") { bool fatal_errors = false; - uwuw_preprocessor* uwuw_preproc = new uwuw_preprocessor(pyne_mat_lib, filename, filename, hdf5_path, verbose_warnings, fatal_errors); + uwuw_preprocessor* uwuw_preproc = new uwuw_preprocessor(pyne_mat_lib, mdbImpl, filename, hdf5_path, true, fatal_errors); + std::cout << __FILE__ << " : " << __LINE__ << std::endl; // process the materials uwuw_preproc->process_materials(); + std::cout << __FILE__ << " : " << __LINE__ << std::endl; // process the tallies uwuw_preproc->process_tallies(); + std::cout << __FILE__ << " : " << __LINE__ << std::endl; // write the material data uwuw_preproc->write_uwuw_materials(); + std::cout << __FILE__ << " : " << __LINE__ << std::endl; // write the tally data uwuw_preproc->write_uwuw_tallies(); + std::cout << __FILE__ << " : " << __LINE__ << std::endl; + } + rval = teardown(); + CHK_MB_ERR_RET("Error tearing down export command.",rval); + return result; } @@ -222,8 +229,15 @@ moab::ErrorCode DAGMCExportCommand::parse_options(CubitCommandData &data, moab:: data.get_string("pyne_mat_lib", pyne_mat_lib); if (pyne_mat_lib != "") { message << "Looking for the PyNE material Lib in " << pyne_mat_lib << std::endl; - data.get_string("hdf5_path",hdf5_path); - message << "hdf5 path set to " << hdf5_path << std::endl; + data.get_string("hdf5_path",hdf5); + if (hdf5 != "") { + hdf5_path = hdf5; + } else { + message << "hdf5 path not provided, falling back on default path" + << std::endl; + } + + message << "hdf5 path set to " << hdf5 << std::endl; } else { message diff --git a/export_dagmc_cmd/DAGMCExportCommand.hpp b/export_dagmc_cmd/DAGMCExportCommand.hpp index ebbc625f7..966c19fc2 100644 --- a/export_dagmc_cmd/DAGMCExportCommand.hpp +++ b/export_dagmc_cmd/DAGMCExportCommand.hpp @@ -72,6 +72,7 @@ class DAGMCExportCommand: public CubitCommand bool make_watertight; std::string pyne_mat_lib; std::string hdf5_path; + std::string hdf5; int failed_curve_count; diff --git a/script/build_plugin.sh b/script/build_plugin.sh index 43ab86dd4..15bd3d7b5 100755 --- a/script/build_plugin.sh +++ b/script/build_plugin.sh @@ -48,7 +48,10 @@ make install cd ${PLUGIN_ABS_PATH} mkdir -pv DAGMC/bld cd DAGMC -git clone https://github.com/svalinn/DAGMC -b develop +git clone https://github.com/bam241/DAGMC -b preproc_plugin +cd DAGMC +git status +cd .. cd bld cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ -DMOAB_DIR=${PLUGIN_ABS_PATH}/moab \ From adca3fec371f78683a50fee3dcec904e6dc399ff Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Wed, 28 Oct 2020 16:26:56 -0500 Subject: [PATCH 21/21] fixing verison of the script used --- script/build_plug_linux.sh | 2 +- script/build_plugin.sh | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/script/build_plug_linux.sh b/script/build_plug_linux.sh index b2aac02e2..afd0dfd1d 100755 --- a/script/build_plug_linux.sh +++ b/script/build_plug_linux.sh @@ -1,4 +1,4 @@ #!/bin/bash SCRIPTPATH=`dirname $(dirname $(realpath $0))` -docker run -v "$SCRIPTPATH:/Trelis-plugin" -v "$2:/Trelis-sdk" -it $1 bash -c "/Trelis-plugin/script/build_plugin.sh $3" \ No newline at end of file +docker run -v "$SCRIPTPATH:/Trelis-plugin" -v "$2:/Trelis-sdk" -it $1 bash -c "/Trelis-plugin/script/build_plugin.sh $3; bash" diff --git a/script/build_plugin.sh b/script/build_plugin.sh index 15bd3d7b5..15bbddc20 100755 --- a/script/build_plugin.sh +++ b/script/build_plugin.sh @@ -5,6 +5,8 @@ dpkg -i Trelis-$1-Lin64.deb cd /opt tar -xzvf /Trelis-sdk/Trelis-SDK-$1-Lin64.tar.gz +cd /opt/Trelis-16.5 +tar -xzvf /Trelis-sdk/Trelis-SDK-$1-Lin64.tar.gz apt-get update -y apt-get install -y autogen autoconf libtool libeigen3-dev libhdf5-dev patchelf gfortran git cmake @@ -49,9 +51,6 @@ cd ${PLUGIN_ABS_PATH} mkdir -pv DAGMC/bld cd DAGMC git clone https://github.com/bam241/DAGMC -b preproc_plugin -cd DAGMC -git status -cd .. cd bld cmake ../DAGMC -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 \ -DMOAB_DIR=${PLUGIN_ABS_PATH}/moab \ @@ -73,13 +72,20 @@ git submodule update --init cd ${PLUGIN_ABS_PATH} mkdir -pv bld cd bld -cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-17.1 \ +ls /opt/Trelis-${1::4} +ls /opt/Trelis-* +ls /opt +cmake ../Trelis-plugin -DCUBIT_ROOT=/opt/Trelis-${1::4} \ -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} make -j`grep -c processor /proc/cpuinfo` make install - +echo " cmake ../Trelis-plugin -DCubit_DIR=/opt/Trelis-${1::4} \ + -DCUBIT_ROOT=/opt/Trelis-${1::4} \ + -DDAGMC_DIR=${PLUGIN_ABS_PATH}/DAGMC \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PLUGIN_ABS_PATH} " cd ${PLUGIN_ABS_PATH} mkdir -p pack/bin/plugins/svalinn @@ -96,12 +102,11 @@ cp -pPv /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100* . chmod 644 * # Set the RPATH to be the current directory for the DAGMC libraries -patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libMOAB.so -patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libdagmc.so -patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libmakeWatertight.so -patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libpyne_dagmc.so -#patchelf --set-rpath /opt/Trelis-$1/bin/plugins libsvalinn_plugin.so -patchelf --set-rpath /opt/Trelis-${1%.??}/bin/plugins/svalinn libuwuw.so +patchelf --set-rpath /opt/Trelis-${1::4}/bin/plugins/svalinn libMOAB.so +patchelf --set-rpath /opt/Trelis-${1::4}/bin/plugins/svalinn libdagmc.so +patchelf --set-rpath /opt/Trelis-${1::4}/bin/plugins/svalinn libmakeWatertight.so +patchelf --set-rpath /opt/Trelis-${1::4}/bin/plugins/svalinn libpyne_dagmc.so +patchelf --set-rpath /opt/Trelis-${1::4}/bin/plugins/svalinn libuwuw.so # Create the Svalinn plugin tarball cd ..