SIVICLab / sivic

SIVIC is an open-source, standards-based software framework and application suite for processing and visualizing DICOM MR Spectroscopy data. Through the use of DICOM, SIVIC aims to facilitate the application of MRS in medical imaging studies. The SIVIC code repository lives on github but our user portal is on sourceforge.
https://sourceforge.net/p/sivic/sivicwiki/Home/
Other
29 stars 14 forks source link

Create updated build wiki. #83

Closed jedchan closed 3 weeks ago

jedchan commented 7 months ago

Hi SIVIC devs. @agentmess. @jccrane and @beckolson

I couldn't find official build instructions and thought I would give it try and build it myself outside the confines of UCSF. This took several days, but I managed to build sivic from the older build page instructions on Sourceforge here:

https://sourceforge.net/p/sivic/sivicwiki/svk_installation/

The information here needs updating, but luckily I was able to figure out how to build SIVIC based on the information in the cmake files. I'll post updated build instructions in this issue. If possible, this should be added to the wiki or README.md. I can do a PR if this is preferred.

jedchan commented 7 months ago

Instructions - This was Built using CentOS 7.9 ( GCC 4.8.5 / GLIBC 2.17). Build is forward compatible with EL8 and EL9. Make sure to install the minimum required packages to build SIVIC described in this Dockerfile: https://github.com/SIVICLab/sivic/blob/master/docker/centos7/Dockerfile

NOTE - These packages maybe required as well in addition to the ones mentioned in the docker file: mesa* libXmu libXmu-devel libXres-devel libXres libXdmcp libXdmcp-devel lapack-static lapack-devel

  1. Download the following packages

  2. Build and install TCL and TK packages (version 8.5.19)

    • ../configure --prefix=/usr/local/sivic/build/deps/tcl8.5.19 --enable-shared
    • ../configure --with-x --prefix=/usr/local/sivic/build/deps/tk8.5.19 --with-tcl=/usr/local/sivic/build/deps/tcl8.5.19/lib --enable-shared
    • make -j
    • make install
  3. Build and install DCMTK 3.6.7 (cmake)

    • BUILD_SHARED_LIBS=ON
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/build/deps/dcmtk-3.6.7
  4. Build and install ITK 4.4.1 (cmake)

    • BUILD_EXAMPLES=OFF
    • BUILD_SHARED_LIBS=ON
    • BUILD_TESTING=OFF
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/build/deps/ITK-4.4.1
  5. Build and install clapack 3.2.1 (cmake)

    • BUILD_TESTING=OFF
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/build/deps/clapack-3.2.1
    • USE_BLAS_WRAP=ON

Once clapack is built and installed, create softlinks for clapack. This is a workaround for the SIVIC cmake files

bash-4.2$ cd /usr/local/sivic/build/deps/clapack-3.2.1/lib bash-4.2$ ln -s liblapack.a libclapack.a bash-4.2$ ln -s libblas.a libcblas.a

  1. Build and install VTK 6.3.0 (cmake)

    • BUILD_SHARED_LIBS=ON
    • BUILD_TESTING=OFF
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/build/deps/VTK-6.3.0
    • VTK_Group_Tk=ON
    • VTK_USE_TK=ON
    • VTK_TCL_TK_STATIC=ON
    • Module_vtkWrappingTcl=ON
    • Module_vtkTclTk=ON
    • TCL_LIBRARY=/usr/local/sivic/build/deps/tcl8.5.19/lib/libtcl8.5.so
    • TCL_TCLSH=/usr/local/sivic/build/deps/tcl8.5.19/bin/tclsh8.5
    • TK_INCLUDE_PATH=/usr/local/sivic/build/deps/tk8.5.19/include
    • TK_LIBRARY=/usr/local/sivic/build/deps/tk8.5.19/lib/libtk8.5.so
  2. set environment variables for DCMTK_DIR and VTK_DIR

    • export DCMTK_DIR=/usr/local/sivic/build/deps/dcmtk-3.6.7
    • export VTK_DIR=/usr/local/sivic/build/deps/VTK-6.3.0
  3. Build and install KWWidgets (cmake) - make sure to perform step 7 first before running cmake

    • BUILD_TESTING=OFF
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/build/deps/KWWidgets
    • VTK_DIR=/usr/local/sivic/build/deps/VTK-6.3.0/lib/cmake/vtk-6.3
    • TCL_INCLUDE_PATH=/usr/local/sivic/build/deps/tcl8.5.19/include
    • TCL_LIBRARY=/usr/local/sivic/build/deps/tcl8.5.19/lib/libtcl8.5.so
    • TCL_TCLSH=/usr/local/sivic/build/deps/tcl8.5.19/bin/tclsh8.5
    • TK_INCLUDE_PATH=/usr/local/sivic/build/deps/tk8.5.19/include
    • TK_LIBRARY=/usr/local/sivic/build/deps/tk8.5.19/lib/libtk8.5.so
  4. Build and Install openssl

    • ../configure --prefix=/usr/local/sivic/build/deps/openssl-openssl-3.0.7
    • make -j 4
    • make install
    • cd /usr/local/sivic/build/deps/openssl-openssl-3.0.7
    • ln -s lib64 lib
  5. Build and Install SIVIC (cmake) - make sure to perform step 7 first before running cmake

    • BUILD_APPS=ON
    • BUILD_CREATE_RAW=ON
    • BUILD_CLAPACK=ON
    • CLAPACK_DIR=/usr/local/sivic/build/deps/clapack-3.2.1/lib
    • CMAKE_INSTALL_PREFIX=/usr/local/sivic/sivic
    • DCMTK_DIR=/usr/local/sivic/build/deps/dcmtk-3.6.7
    • ITK_DIR=/sivic/build/deps/ITK-4.4.1/lib/cmake/ITK-4.4
    • KWWidgets_DIR=/usr/local/sivic/build/deps/KWWidgets/lib/KWWidgets
    • VTK_DIR=/usr/local/sivic/build/deps/VTK-6.3.0/lib/cmake/vtk-6.3
    • OPENSSL_DIR=/usr/local/sivic/build/deps/openssl-openssl-3.0.7
    • UCSF_INTERNAL=ON

(note) - UCSF_INTERNAL and BUILD_APPS need to be enabled to build UCSF Radiology command line tools in addition to the SIVIC GUI

Before building SIVIC, make sure to edit svkHSVD.h and change the #include "f2c.h" line and have it point to "/usr/local/sivic/build/deps/clapack-3.2.1/include/f2c.h"

  1. (optional - needs testing ) Copy the contents of /usr/local/sivic to /usr/local on an EL8 or EL9 system. This will run as long as the appropriate compatibility libraries are installed
jedchan commented 7 months ago

I will need to create PRs for the following items. Pending approval from mgmt:

https://github.com/SIVICLab/sivic/commit/16c667454c5ebbf2fa417988e0f3af5e30ea791c#commitcomment-140393442 https://github.com/SIVICLab/sivic/commit/d2ef70f64857d9633beaeedf02424f88203c6bcc#commitcomment-140393463

jedchan commented 6 months ago

32bit support has been removed since OSX Mojave so building dependencies using 32bit compatibility flags will fail.

jedchan commented 6 months ago

BUILD_APPS needs to be enabled in order to build command line tools. OPENSSL is needed as well.

agentmess commented 3 weeks ago

Now added to README