Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions for building omniscidb from source #2

Open
pearu opened this issue Aug 22, 2019 · 12 comments
Open

Instructions for building omniscidb from source #2

pearu opened this issue Aug 22, 2019 · 12 comments
Assignees
Labels
HOWTO Instructions for how-to a thing.

Comments

@pearu
Copy link
Contributor

pearu commented Aug 22, 2019

  1. Setup and activate conda environment:
wget https://raw.githubusercontent.com/Quansight/pearu-sandbox/master/conda-envs/omniscidb-cpu-dev.yaml
conda env create --file=omniscidb-cpu-dev.yaml -n omniscidb-cpu-dev
conda activate omniscidb-cpu-dev

When enabling CUDA build, execute also:

conda install -c conda-forge cudatoolkit-dev  # this takes a couple of minutes, be patient
  1. Checkout or download omnscidb source, for instance:
git clone https://github.com/omnisci/omniscidb
git clone git@github.com:omnisci/omniscidb-internal.git
  1. Prepare build environment:
export PREFIX=$CONDA_PREFIX
export LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib"
export CXXFLAGS="`echo $CXXFLAGS | sed 's/-fPIC//'`"
export CC=clang
export CXX=clang++
export CGO_ENABLED=1
export CGO_LDFLAGS=
export CGO_CFLAGS=
export CGO_CPPFLAGS=
export CXXFLAGS="$CXXFLAGS -DBOOST_ERROR_CODE_HEADER_ONLY"

export ZLIB_ROOT=$PREFIX
export LibArchive_ROOT=$PREFIX
export Curses_ROOT=$PREFIX
export Glog_ROOT=$PREFIX
export Snappy_ROOT=$PREFIX
export Boost_ROOT=$PREFIX
export PNG_ROOT=$PREFIX
export GDAL_ROOT=$PREFIX
export BLOSC_ROOT=$PREFIX

Note that conda install ... will change the current environment, so, one must also reset the build environment whenever conda program has been used.

On some systems, one may also need to define

When enabling CUDA build, set also:

export LDFLAGS="$LDFLAGS -L$PREFIX/lib/stubs -Wl,-rpath-link,$PREFIX/lib/stubs"
export EXTRA_CMAKE_OPTIONS="$EXTRA_CMAKE_OPTIONS -DCMAKE_LIBRARY_PATH=$PREFIX/lib/stubs"
export LD_LIBRARY_PATH=/path/to/libcuda.so.1/directory/
  1. When on MacOSX, one may want to apply a fix from issue Adjust OpenSSL path when building omnscidb on MacOSX #11 .
  2. Build omniscdb:
cd omniscidb
mkdir -p build && cd build
cmake -Wno-dev \
    -DCMAKE_INSTALL_PREFIX=$PREFIX \
   -DCMAKE_PREFIX_PATH=$PREFIX \
    -DCMAKE_BUILD_TYPE=debug \
    -DMAPD_DOCS_DOWNLOAD=off \
    -DENABLE_AWS_S3=off \
    -DENABLE_CUDA=off \
    -DENABLE_FOLLY=off \
    -DENABLE_JAVA_REMOTE_DEBUG=off \
    -DENABLE_PROFILER=off \
    -DENABLE_TESTS=on  \
    -DPREFER_STATIC_LIBS=off \
    -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
    -DMAPD_EDITION=EE \
    ..
make -j `nproc`

When enabling CUDA build, use:

    -DENABLE_CUDA=on
  1. Run sanity tests:
mkdir -p tmp && bin/initdb tmp
make sanity_tests

In the case of failures, check out the following issues: #12 .

  1. Run omnscidb server
mkdir -p data && bin/initdb data
bin/omnisci_server --enable-runtime-udf
@mpeaton
Copy link

mpeaton commented Aug 22, 2019

following these instructions using latest omniscdb on iMac without cuda support yielded error:

/Users/mpeaton/omniscidb/Shared/TimeGM.h:134:15: error: variables defined in a constexpr function must be initialized
        char* endptr;
              ^
1 error generated.
make[2]: *** [Shared/CMakeFiles/Shared.dir/build.make:63: Shared/CMakeFiles/Shared.dir/Datum.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 18%] Built target Fragmenter
[ 19%] Generating bin/omnisci_web_server
In file included from /Users/mpeaton/omniscidb/Shared/timegm.cpp:34:
/Users/mpeaton/omniscidb/Shared/TimeGM.h:134:15: error: variables defined in a constexpr function must be initialized
        char* endptr;
              ^
1 error generated.
make[2]: *** [Shared/CMakeFiles/Shared.dir/build.make:76: Shared/CMakeFiles/Shared.dir/timegm.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1624: Shared/CMakeFiles/Shared.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
# runtime/cgo
_cgo_export.c:3:10: fatal error: 'stdlib.h' file not found
make[2]: *** [CMakeFiles/omnisci_web_server.dir/build.make:1268: bin/omnisci_web_server] Error 2
make[1]: *** [CMakeFiles/Makefile2:212: CMakeFiles/omnisci_web_server.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

maybe operator, no specific reason to spend time on it at present. Are you building on a specific platform/compiler?

@pearu
Copy link
Contributor Author

pearu commented Aug 22, 2019

I am building on omniscidb-internal (using clang-8) which is a little ahead of the latest omniscidb.

The first issue has fixed in https://github.com/omnisci/omniscidb-internal/pull/3698 .
If not available to you, one must have char* endptr = nullptr;.

@pearu pearu self-assigned this Aug 22, 2019
@pearu pearu added the HOWTO Instructions for how-to a thing. label Aug 22, 2019
@mpeaton
Copy link

mpeaton commented Aug 22, 2019

Ok, and apparently I need to add some paths to header files for my system I want to build native/locally.

./SDKs/MacOSX.sdk 1/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/kern/assert.h
./SDKs/MacOSX.sdk 1/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/assert.h
./SDKs/MacOSX10.15.sdk/usr/include/assert.h
./SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/kern/assert.h
./SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/assert.h

@mpeaton mpeaton closed this as completed Aug 22, 2019
@pearu
Copy link
Contributor Author

pearu commented Aug 22, 2019

This issue is not meant to be closed.

@pearu pearu reopened this Aug 22, 2019
@mpeaton
Copy link

mpeaton commented Aug 22, 2019

Is the idea to build independent of native system tools using conda only? If so, I think there may be unsatisfied linux dependencies as well.

@pearu
Copy link
Contributor Author

pearu commented Aug 22, 2019

Yes. What linux dependencies are you keeping in mind?

@mpeaton
Copy link

mpeaton commented Aug 23, 2019

Oh for me on standard AWS instance for example, there are no build tools, so conda install using your .yml needed binutils for ld, and then was complaining about some other libraries crt1.o being one I recall.

@pearu
Copy link
Contributor Author

pearu commented Aug 23, 2019

I would be interested in what would be a minimal system requirement for building any library from a conda environment. Would binutils (for ld) and libc6-dev (for crt1.o and more) be a minimal set?

Btw, in one ubuntu 18.04 box, building omniscidb also complains about not finding crt1.o, although, it is in the system. So, there is room for improving building instructions.

@mpeaton
Copy link

mpeaton commented Aug 23, 2019

well libc6-dev doesn't appear to be available for NAME="Red Hat Enterprise Linux" VERSION="8.0 (Ootpa)" , and sudo yum group install "Development Tools" did not appear to satisfy the crt1.o dependency, though imho it should.

@pearu
Copy link
Contributor Author

pearu commented Aug 23, 2019

Redhat equivalent to libc6-dev might be glibc-devel.

@pearu
Copy link
Contributor Author

pearu commented Aug 26, 2019

@mpeaton I was able to reproduce the crt1.o issue in a Centos 7.5 box. The solution is

conda install -c conda-forge compilers

(and re-prepare the build environment).

@mpeaton
Copy link

mpeaton commented Aug 27, 2019

conda install -c conda-forge compilers did seem to improve matters in my build environment. I still have errors due to what I believe you mentioned was an outdated version of the repo. I notice you added it to the omnisci-cpu-dev.yml, so that's good I guess. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HOWTO Instructions for how-to a thing.
Projects
None yet
Development

No branches or pull requests

2 participants