Skip to content

Commit

Permalink
Adding IDX2
Browse files Browse the repository at this point in the history
  • Loading branch information
scrgiorgio committed May 6, 2024
1 parent e9b0f7a commit 3d3460c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 203 deletions.
30 changes: 1 addition & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# must be before PROJECT command
SET(MSVC_INCREMENTAL_DEFAULT OFF)


option(VISUS_MINIMAL "Enable VISUS_MINIMAL" OFF)


# this must be before project
if (VISUS_MINIMAL)
MESSAGE(STATUS "Forcing static linking on MSVC")
SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()


PROJECT(OpenVisus)

# todo this default for linux too
Expand Down Expand Up @@ -182,21 +171,6 @@ option(VISUS_HDF5 "Enable VISUS_HDF5" OFF)
option(VISUS_WEAVING "Enable VISUS_WEAVING" OFF)
option(VISUS_IDX2 "Enable VISUS_IDX2" ON) # 20240506 scrgiorgio: changing default to ON

if (VISUS_MINIMAL)
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_NET OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_IMAGE OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_DATAFLOW OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_PYTHON OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_GUI OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_MODVISUS OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_SLAM OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_OSPRAY OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_HDF5 OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_WEAVING OFF CACHE BOOL "disabled" FORCE)
SET(VISUS_IDX2 OFF CACHE BOOL "disabled" FORCE)
endif()

MESSAGE(STATUS "BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}")
MESSAGE(STATUS "VISUS_NET ${VISUS_NET}")
MESSAGE(STATUS "VISUS_IMAGE ${VISUS_IMAGE}")
Expand Down Expand Up @@ -239,10 +213,8 @@ endif()

add_subdirectory(ExternalLibs)
add_subdirectory(Libs)
add_subdirectory(Executable)

if (NOT VISUS_MINIMAL)
add_subdirectory(Executable)
endif()

# ///////////////////////////////////////////////////////////////////////////
# install step (NOTE: there is no need to install binaries/libraries since they are already in correct position)
Expand Down
2 changes: 1 addition & 1 deletion Executable/hdf5_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Run cmake and Configure/Generate/Configure/Generate as usual (**change values as
- Where the source code: `D:/hdf5`
- Where to build the binaries `D:/hdf5/build`
- Compiler: `Visual Studio 16 2019`
- Compiler: `Visual Studio 17 2022`
- Platform: `x64`
- Change the `CMAKE_INSTALL_PREFIX` to `d:/hdf5/install`
Expand Down
46 changes: 0 additions & 46 deletions Executable/test_static_linking/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,4 @@

# Example of producing a minimal static library

Minimal means:
- no python
- no FreeImage
- no CURL network service
- no Gui
- just flat OpenVisus IDX (i.e. Kernel and DB)


(OPTIONAL) Set the path to find cmake:

```
set PATH="C:\Program Files\CMake\bin";%PATH
```

Choose the configuration you want to try (DO NOT mix Debug with Release and viceversa):

```
set CONFIG=Release
```

Compile OpenVisus static library (NOTE I am compiling/installing all configurations just in case):

```
mkdir build_minimal
cd build_minimal
cmake -G "Visual Studio 16 2019" -A "x64" -DVISUS_MINIMAL=1 ../
cmake --build . --target ALL_BUILD --config %CONFIG%
cmake --build . --target INSTALL --config %CONFIG%
set OPENVISUS_DIR=%cd%\%CONFIG%\OpenVisus
cd ..
```

Then consume the library linking:

```
cd Executable\test_static_linking
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A "x64" -DOPENVISUS_DIR=%OPENVISUS_DIR% ../
cmake --build . --target ALL_BUILD --config %CONFIG%
```






126 changes: 1 addition & 125 deletions docs/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ git clone https://github.com/sci-visus/OpenVisus
cd OpenVisus
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A "x64" -DQt5_DIR=%Qt5_DIR% -DPython_EXECUTABLE=%Python_EXECUTABLE% ../
cmake -G "Visual Studio 17 2022" -A "x64" -DQt5_DIR=%Qt5_DIR% -DPython_EXECUTABLE=%Python_EXECUTABLE% ../
cmake --build . --target ALL_BUILD --config Release
cmake --build . --target INSTALL --config Release
Expand All @@ -47,38 +47,6 @@ python -m OpenVisus viewer
```


<!--//////////////////////////////////////////////////////////////////////// -->
## Windows compilation mingw



Install prerequisites. The fastest way is to use `chocolatey`:

```
choco install -y git cmake mingw
```

To compile OpenVisus (change the paths as needed):

```
git clone https://github.com/sci-visus/OpenVisus
cd OpenVisus
mkdir build_gcc
cd build_gcc
set PATH=%PATH%;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
# NOTE: only VISUS_MINIMAL is supported.
cmake -G "MinGW Makefiles" -DVISUS_MINIMAL=1 ../
cmake --build . --target all --config Release
cmake --build . --target install --config Release
set PYTHON_PATH=.\Release
python -m OpenVisus configure --user
python -m OpenVisus viewer
```


<!--//////////////////////////////////////////////////////////////////////// -->
## MacOSX compilation clang
Expand Down Expand Up @@ -289,98 +257,6 @@ PYTHONPATH=$(pwd)/Release python3 -m OpenVisus viewer
```


<!--//////////////////////////////d////////////////////////////////////////// -->
## Minimal compilation

Minimal compilation disable

- Image support
- Network support
- Python supports

it enables only minimal IDX read/write operations.

For Windows/Visual Studio:

```
mkdir build && cd build
cmake -G "Visual Studio 16 2019" -A "x64" -DVISUS_MINIMAL=1 ../
cmake --build . --target ALL_BUILD --config Release
cmake --build . --target INSTALL --config Release
```

For Windows/mingw

```
choco install -y mingw
set PATH=%PATH%;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
mkdir build && cd build
cmake -G "MinGW Makefiles" -DVISUS_MINIMAL=1 ../
cmake --build . --target all --config Release
cmake --build . --target install --config Release
```

For Apple/Xcode

```
mkdir build && cd build
cmake -GXcode -DVISUS_MINIMAL=1 ../
cmake --build ./ --target ALL_BUILD --config Release --parallel 4
cmake --build ./ --target install --config Release
```

For Apple/gcc:

```
brew install gcc
export CC=cc-9
export CXX=g++-9
mkdir build && cd build
cmake -G"Unix Makefiles" -DVISUS_MINIMAL=1 ../
make -j
make install
```


For Linux/gcc:

```
mkdir build && cd build
cmake -DVISUS_MINIMAL ../
make -j
make install
```


To use the VisusMinimal you can create a Makefile (change as needed):

```
CXX=g++-9 -std=c++11
OpenVisus_DIR=build/Release/OpenVisus
CXX_FLAGS=\
-I$(OpenVisus_DIR)/include/Db \
-I$(OpenVisus_DIR)/include/Kernel \
-DVISUS_STATIC_LIB=1
main: main.o
$(CXX) -o $@ $< -L${OpenVisus_DIR}/lib -lVisusKernel VisusDb
main.o: main.cpp
$(CXX) $(CXX_FLAGS) -c -o $@ $<
clean:
rm -f main main.o
.PHONY: clean
```

If you don't want to use C++11 because you have an old compiler (like C++98) see Executable/use_minimal directory
which use exclusively a `Visus/Minimal.h` header.


<!--//////////////////////////////////////////////////////////////////////// -->
## Commit tag

Expand Down
2 changes: 1 addition & 1 deletion scripts/conda.windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if [[ "1" == "1" ]]; then
BUILD_DIR=build_windows_conda
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
cmake -G "Visual Studio 16 2019" -A x64 \
cmake -G "Visual Studio 17 2022" -A x64 \
-DQt5_DIR=${CONDA_PREFIX}/Library/lib/cmake/Qt5 \
-DSWIG_EXECUTABLE=$(which swig) \
-DPython_EXECUTABLE=${PYTHON} \
Expand Down
2 changes: 1 addition & 1 deletion scripts/cpython.windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if [[ "1" == "1" ]]; then
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
cmake \
-G "Visual Studio 16 2019" \
-G "Visual Studio 17 2022" \
-A x64 \
-DQt5_DIR=${Qt5_Dir} \
-DPython_EXECUTABLE=${PYTHON} \
Expand Down

0 comments on commit 3d3460c

Please sign in to comment.