Compile OpentimelineIO
Here is my current environment:
- CentOS 7
- gcc 12.3.0
- cmake 3.28
- mpfr 4.2.1
- mpc 1.3.1
- gmp 6.3.0
- OpenImageIO v0.15
Clone it
Use git to clone the GitHub repository.
git clone https://github.com/AcademySoftwareFoundation/OpenTimelineIO.git
cd OpenTimelineIO
git checkout v0.15.0
Build it
bash
cmake -S . -B ./build -DCMAKE_INSTALL_PREFIX=<OTIO_SOURCE_DIR>/install\
-DCMAKE_BUILD_TYPE=Release
Compile it
bash
cmake --build ./build --target install
If you got error like this:
bash
In file included from <OPENTIMELINEIO_SOURCE_DIR>/src/opentime/rationalTime.cpp:4:0:
<OPENTIMELINEIO_SOURCE_DIR>/src/opentime/rationalTime.h: In function ‘constexpr double opentime::v1_0::fabs(double)’:
<OPENTIMELINEIO_SOURCE_DIR>/src/opentime/rationalTime.h:32:1: error: body of constexpr function ‘constexpr double opentime::v1_0::fabs(double)’ not a return-statement
}
^
gmake[2]: *** [src/opentime/CMakeFiles/opentime.dir/rationalTime.o] Error 1
gmake[1]: *** [src/opentime/CMakeFiles/opentime.dir/all] Error 2
gmake: *** [all] Error 2
Try adding your gcc binary path to cmake command:
bash
cmake -S . -B ./build -DCMAKE_INSTALL_PREFIX=<OTIO_SOURCE_DIR>/install\
-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=<GCC_ROOT_DIR>/bin/gcc
You can check this discussion on OpenTimelineIO GitHub repository for more information about this error.