Skip to content

Commit

Permalink
New3rd party libraries (#3110)
Browse files Browse the repository at this point in the history
* Update new 3rd party libraries for 3.7

* fix ubuntu build

* fix 3rd party library file names

* fix 3rd party library file names

* updates

* update cmakelists

* turn off installer builds

* change hdf5 plugin path

* fix typo

* add HDF5 env variable to windows

* simplify hdf5 plugin path on UNIX

* Remove HDF5 plugin error

* create SetHDF5pluginPath() in lib/common/ResourcePath.cpp

* revert some CMakeLists.txt changes

* test

* windows update

* fix CI conflict

* fix CI conflict

* osx update

* update plugin installation path

* test

* test

* Test

* Test

* Test

* add message

* fix osx build and address comments

* test installer builds

* swap libraries to vdc for SetHDF5PluginPath

* forgot to add the important file

* turn off build tests

Co-authored-by: vapor2 <vapor2@localhost.localdomain>
  • Loading branch information
sgpearse and vapor2 committed Aug 17, 2022
1 parent 6db9438 commit d8927ae
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 10 deletions.
23 changes: 16 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ jobs:
- run:
name: Get libomp
command: |
sudo /opt/local/bin/port selfupdate
(sudo yes || true) | sudo /opt/local/bin/port install libomp
#sudo /opt/local/bin/port selfupdate
#(sudo yes || true) | sudo /opt/local/bin/port install libomp
no_output_timeout: 30m

- run:
name: Get clang12
name: Get clang13
command: |
(sudo yes || true) | sudo /opt/local/bin/port install clang-12
sudo /opt/local/bin/port select --set clang mp-clang-12
sudo /opt/local/bin/port selfupdate
(sudo yes || true) | sudo /opt/local/bin/port install clang-13
sudo /opt/local/bin/port select --set clang mp-clang-13
/opt/local/bin/clang++ -v > clangVersion.txt
no_output_timeout: 30m

Expand All @@ -130,7 +131,7 @@ jobs:
cd build
git checkout $CIRCLE_BRANCH
export PATH=/opt/local/bin:$PATH
sudo port select --set clang mp-clang-12
sudo port select --set clang mp-clang-13
cmake -DCPACK_BINARY_DRAGNDROP=ON -DCMAKE_BUILD_TYPE:String=Release -DDIST_INSTALLER:string=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DUSE_OMP=ON ..
make -j2
make installer -j2
Expand Down Expand Up @@ -349,6 +350,15 @@ jobs:
pip3 install scikit-build command
- run:
name: update 3rd party libraries
command: |
rm -rf /usr/local/VAPOR-Deps/2019-Aug
pip3 install gdown --upgrade
gdown https://drive.google.com/uc?id=1elB8v-UNMzkNmnsJPtxk3cI1zBelJ3Hd
filename="/root/project/2019-Aug-Ubuntu.tar.xz"
tar -xf ${filename} -C /usr/local/VAPOR-Deps
- run:
name: update cmake
command: |
apt remove -y --purge --auto-remove cmake
Expand Down Expand Up @@ -640,7 +650,6 @@ workflows:
#- clang-tidy
- build_ubuntu18
- build_centos7
#- foo
#- test_clang_format
#- build_win10_installer
#- build_osx_installer
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ find_library(UDUNITS2 udunits2)
find_library(FREETYPE freetype)
find_library(GEOTIFF geotiff)
find_library(JPEG jpeg)
find_library(HDF5_LIB hdf5)

# find_package(Python)
# Output
Expand Down Expand Up @@ -342,6 +343,11 @@ if (WIN32)
${QTDIR}/plugins/platforms/qwindows.dll
DESTINATION platforms
)
install (
DIRECTORY ${THIRD_PARTY_DIR}/share/plugins
DESTINATION ${INSTALL_LIB_DIR}/share
COMPONENT Dependencies
)
endif (GENERATE_FULL_INSTALLER)

set (CPACK_NSIS_MODIFY_PATH OFF)
Expand Down Expand Up @@ -415,6 +421,12 @@ if (APPLE)
COMPONENT Dependencies
)
endif ()
file (GLOB_RECURSE HDF5_PLUGINS "${THIRD_PARTY_DIR}/share/plugins/*.so")
install (
FILES ${HDF5_PLUGINS}
DESTINATION "${INSTALL_SHARE_DIR}/plugins"
COMPONENT Dependencies
)

endif ()
endif (APPLE)
Expand All @@ -434,6 +446,9 @@ if (UNIX AND NOT APPLE)
if (BUILD_PYTHON)
set (PARSE_BINARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libvapi.so")
endif()
message( STATUS "${CMAKE_SOURCE_DIR}/buildutils/gen_linux_shared_libs.pl
${PARSE_BINARY} ${EXTRA_LIBS_SEARCH} >
${CMAKE_BINARY_DIR}/LinuxInstallLibs.txt")
add_custom_target (
linuxpreinstall
COMMAND ${CMAKE_SOURCE_DIR}/buildutils/gen_linux_shared_libs.pl
Expand Down Expand Up @@ -490,6 +505,13 @@ if (UNIX AND NOT APPLE)
)
endif ()

file (GLOB HDF5_PLUGINS "${THIRD_PARTY_DIR}/share/plugins/*.so")
message(STATUS "HDF5_PLUGINS ${HDF5_PLUGINS}")
install (
FILES ${HDF5_PLUGINS}
DESTINATION "${INSTALL_SHARE_DIR}/plugins"
COMPONENT Dependencies
)

endif (DIST_INSTALLER AND GENERATE_FULL_INSTALLER)
endif (UNIX AND NOT APPLE)
Expand Down
3 changes: 3 additions & 0 deletions apps/cf2vdc/cf2vdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vapor/VDCNetCDF.h>
#include <vapor/DCCF.h>
#include <vapor/FileUtils.h>
#include <vapor/SetHDF5PluginPath.h>

using namespace Wasp;
using namespace VAPoR;
Expand Down Expand Up @@ -223,6 +224,8 @@ vector<string> remove_vector(vector<string> v1, vector<string> v2)

int main(int argc, char **argv)
{
VAPoR::SetHDF5PluginPath();

OptionParser op;

MyBase::SetErrMsgFilePtr(stderr);
Expand Down
3 changes: 3 additions & 0 deletions apps/cfvdccreate/cfvdccreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vapor/VDCNetCDF.h>
#include <vapor/DCCF.h>
#include <vapor/FileUtils.h>
#include <vapor/SetHDF5PluginPath.h>

using namespace Wasp;
using namespace VAPoR;
Expand Down Expand Up @@ -144,6 +145,8 @@ void defineMapProjection(const DCCF &dc, VDCNetCDF &vdc) { vdc.SetMapProjection(

int main(int argc, char **argv)
{
VAPoR::SetHDF5PluginPath();

OptionParser op;

MyBase::SetErrMsgFilePtr(stderr);
Expand Down
3 changes: 3 additions & 0 deletions apps/ncdf2wasp/ncdf2wasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <vapor/OptionParser.h>
#include <vapor/WASP.h>
#include <vapor/FileUtils.h>
#include <vapor/SetHDF5PluginPath.h>

using namespace Wasp;
using namespace VAPoR;
Expand Down Expand Up @@ -394,6 +395,8 @@ void Process(string ncdffile, string waspfile)

int main(int argc, char **argv)
{
VAPoR::SetHDF5PluginPath();

OptionParser op;

MyBase::SetErrMsgFilePtr(stderr);
Expand Down
6 changes: 4 additions & 2 deletions apps/vaporgui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include <vapor/OptionParser.h>
#include <vapor/FileUtils.h>
#include <vapor/OSPRay.h>
#include <vapor/SetHDF5PluginPath.h>
#ifdef WIN32
#include "Windows.h"
#endif

using namespace std;
using namespace VAPoR;
using namespace Wasp;
Expand Down Expand Up @@ -151,7 +153,6 @@ int main(int argc, char **argv)
// For Mac and Linux, set the PYTHONHOME in this app
#if PRE_PYTHON_API_REFACTOR
#ifndef WIN32

const char *s = getenv("PYTHONHOME");
string phome = s ? s : "";
if (!phome.empty()) {
Expand All @@ -172,10 +173,11 @@ int main(int argc, char **argv)
setenv("PYTHONHOME", phome.c_str(), 1);
}
MyBase::SetDiagMsg("PYTHONHOME = %s", phome.c_str());

#endif
#endif

VAPoR::SetHDF5PluginPath();

app = &a;

vector<QString> files;
Expand Down
3 changes: 3 additions & 0 deletions apps/wrf2vdc/wrf2vdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vapor/VDCNetCDF.h>
#include <vapor/DCWRF.h>
#include <vapor/FileUtils.h>
#include <vapor/SetHDF5PluginPath.h>

using namespace Wasp;
using namespace VAPoR;
Expand Down Expand Up @@ -54,6 +55,8 @@ string ProgName;

int main(int argc, char **argv)
{
VAPoR::SetHDF5PluginPath();

OptionParser op;

MyBase::SetErrMsgFilePtr(stderr);
Expand Down
3 changes: 3 additions & 0 deletions apps/wrfvdccreate/wrfvdccreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vapor/VDCNetCDF.h>
#include <vapor/DCWRF.h>
#include <vapor/FileUtils.h>
#include <vapor/SetHDF5PluginPath.h>

using namespace Wasp;
using namespace VAPoR;
Expand Down Expand Up @@ -58,6 +59,8 @@ void defineMapProjection(const DCWRF &dcwrf, VDCNetCDF &vdc) { vdc.SetMapProject

int main(int argc, char **argv)
{
VAPoR::SetHDF5PluginPath();

OptionParser op;

MyBase::SetErrMsgFilePtr(stderr);
Expand Down
21 changes: 21 additions & 0 deletions include/vapor/SetHDF5PluginPath.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include "vapor/ResourcePath.h"

#ifndef WIN32
#include <H5PLpublic.h>
#endif

namespace VAPoR {
VDF_API void SetHDF5PluginPath() {
string plugins = Wasp::GetSharePath("plugins");

#ifndef WIN32
H5PLreplace(plugins.c_str(), 0);
#else
plugins = "HDF5_PLUGIN_PATH=" + plugins;
int rc=_putenv(plugins.c_str());
if (rc != 0) MyBase::SetErrMsg("Unable to set environtment variable %s", plugins.c_str());
#endif
}
}; // namespace VAPoR
2 changes: 1 addition & 1 deletion lib/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (CONDA_BUILD AND UNIX AND NOT APPLE)
endif()

if (NOT WIN32)
target_link_libraries (common pthread)
target_link_libraries (common pthread ${HDF5_LIB})
add_definitions (-DENABLE_THREADS)
endif()

Expand Down
1 change: 1 addition & 0 deletions lib/vdc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ set (HEADERS
${PROJECT_SOURCE_DIR}/include/vapor/OpenMPSupport.h
${PROJECT_SOURCE_DIR}/include/vapor/DCUGRID.h
${PROJECT_SOURCE_DIR}/include/vapor/UnstructuredGridCoordless.h
${PROJECT_SOURCE_DIR}/include/vapor/SetHDF5PluginPath.h
)

add_library (vdc SHARED ${SRC} ${HEADERS})
Expand Down

0 comments on commit d8927ae

Please sign in to comment.