Skip to content

Commit

Permalink
Updates for serial build
Browse files Browse the repository at this point in the history
Add SEACAS_HAVE_MPI include guards for ioss unit_tests that use MPI.
These are still run for serial builds and this change allows them to
compile and run.

Add -DMATIO_SHARED:BOOL=${SHARED} to TPS/matio/runcmake.sh. Matio's
CMake isn't respecting the CMAKE variable BUILD_SHARED_LIBS and still
builds shared version when SHARED=NO.
  • Loading branch information
gjtempl committed May 17, 2022
1 parent a5761b6 commit 48bf085
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions TPL/matio/runcmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ rm -f config.cache

cmake .. -DCMAKE_C_COMPILER:FILEPATH=${CC} \
-DBUILD_SHARED_LIBS:BOOL=${SHARED} \
-DMATIO_SHARED:BOOL=${SHARED} \
-DMATIO_DEFAULT_FILE_VERSION=7.3 \
-DMATIO_MAT73:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \
Expand Down
2 changes: 1 addition & 1 deletion install-tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ then
if [ "$DOWNLOAD" == "YES" ]
then
echo "${txtgrn}+++ Downloading...${txtrst}"
rm -rf gtest
rm -rf googletest
git clone https://github.com/google/googletest.git
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#include <Ioss_StandardElementTypes.h>

#include <gtest/gtest.h>
#ifdef SEACAS_HAVE_MPI
#include <mpi.h>
#endif
#include <string>
#include <unordered_map>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <string>
#include <vector>

#ifdef SEACAS_HAVE_MPI
#include "mpi.h"
#endif
#include "gtest/gtest.h"

#include "UnitTestIotmTextMeshFixture.h"
Expand Down
6 changes: 6 additions & 0 deletions packages/seacas/libraries/ioss/src/unit_tests/unitMain.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
// See packages/seacas/LICENSE for details

#include <gtest/gtest.h>
#ifdef SEACAS_HAVE_MPI
#include <mpi.h>
#endif

int main(int argc, char **argv)
{
#ifdef SEACAS_HAVE_MPI
MPI_Init(&argc, &argv);
#endif

testing::InitGoogleTest(&argc, argv);
int errorCode = RUN_ALL_TESTS();

#ifdef SEACAS_HAVE_MPI
MPI_Finalize();
#endif

return errorCode;
}

0 comments on commit 48bf085

Please sign in to comment.