Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Issues in deploying in Linux environment #6

Open
voyagergdn opened this issue Jan 12, 2021 · 3 comments · May be fixed by #15
Open

Issues in deploying in Linux environment #6

voyagergdn opened this issue Jan 12, 2021 · 3 comments · May be fixed by #15

Comments

@voyagergdn
Copy link

Awesome work and I am trying to use the plugin in my UE4 projects. However, I work in Ubuntu environment where the third party libraries are not directly usable. I recompiled all the libraries (4 .a files in "lib" directory and 6 .so files in "redist" directory) needed using clang-8 and replace the lib pathes in "Proj.build.cs" and "SimulationModule.Build.cs". But I still failes when compiling the plugin. The error information is like:

ld.lld: error: undefined symbol: MD5_Init
referenced by md5.c
ld.lld: error: undefined symbol: MD5_Update
referenced by md5.c
and so on.

I guess it is because of the static .a library that I use. So could you please provide a version of this plugin that support Linux environment?

@AlbanBERGERET-Epic
Copy link
Contributor

Hi,

Unfortunately, I don't have enough bandwidth to work on this Linux port. But if you are able to do it, and would like to share, it will be appreciated.

The plugin relies on PROJ library. As it is not provided with binaries, I had to build it manually for windows. using the website instructions, and I did not have any issues with MD5. I guess this is related to the way you built PROJ.

If it can help you, I build it using the vcpkg path (it gather automatically all dependencies such as sqlite3 and tiff libs for x64), then I build PROJ for VS2019 using
cmake -DCMAKE_TOOLCHAIN_FILE=%CURRENTDIR%\ProjBuild\vcpkg\scripts\buildsystems\vcpkg.cmake -DBUILD_PROJSYNC=OFF -DENABLE_CURL=OFF ..
cmake --build . --config Release -j 8

But this is probably quite different for Linux,

@laibe
Copy link

laibe commented Jan 14, 2021

I would be very much interested in a Linux port as well :)

@Nodrev Nodrev linked a pull request Mar 10, 2021 that will close this issue
@Nodrev
Copy link

Nodrev commented Mar 10, 2021

I add here my notes concerning the steps performed in order to compile the c++ dependencies of this plugin (all my Unreal stuff is obviously in /home/jeff/Projets/Unreal directory, you need to adapt this path if you wish to re-compile the libs).

  • The CMake compilation step is because I am using a very old Debian release, so it should not be needed for most users.
  • The LibTiff compilation is a very minimal build, without any external codec.

Build steps:

  • We need to re-compile the plugin for Linux. To work with Unreal, we NEED to use a Unreal specific compilation Toolchain (at least when building for Linux):
    • Use the clang / clang++ compilers available inside UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu
    • DO NOT use the default libstdc++ but the libc++ provided by Epic (see https://adamrehn.com/articles/cross-platform-library-integration-in-unreal-engine-4/#stl-and-libc-issues-under-linux for VERY important information about c++ linkage inside Unreal under Linux environment)
    • Dependencies required:
      • CMake >= 3.9 needed. v3.6 max available on Jessie, so we need to compile it ourself.
        • build from sources (install in /usr/bin):
      • sqlite3 needed:
        • git clone https://github.com/sqlite/sqlite.git
        • cd sqlite
        • git checkout version-3.34.1 (latest version)
        • ./configure --enable-static --disable-shared CC=/home/jeff/Projets/Unreal/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang CFLAGS=-fPIC
        • make + copy generated static lib in GeoCoordinates plugin
      • Libtiff:
        • https://download.osgeo.org/libtiff/tiff-4.2.0.zip (latest version)
        • cd tiff-4.2.0
        • cmake ./ -DCMAKE_C_COMPILER=/home/jeff/Projets/Unreal/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -Dzlib=OFF -Dlibdeflate=OFF -Dpixarlog=OFF -Djpeg=OFF -Dold-jpeg=OFF -Djbig=OFF -Dlzma=OFF -Dzstd=OFF -Dwebp=OFF -Djpeg12=OFF -Dcxx=OFF
        • make + copy generated static lib in GeoCoordinates plugin (exes do not compiles, but static lib does, so we don't care)
      • LibProj:
        • https://download.osgeo.org/proj/proj-8.0.0.tar.gz
        • cd proj-8.0.0
        • mkdir build
        • cd build
        • cmake ../ -DCMAKE_CXX_COMPILER=/home/jeff/Projets/Unreal/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++ -DCMAKE_CXX_LINK_EXECUTABLE=/home/jeff/Projets/Unreal/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/ld.lld -DCMAKE_CXX_FLAGS="-nostdinc++ -std=c++11 -I/home/jeff/Projets/Unreal/UnrealEngine/Engine/Source/ThirdParty/Linux/LibCxx/include -I/home/jeff/Projets/Unreal/UnrealEngine/Engine/Source/ThirdParty/Linux/LibCxx/include/c++/v1" -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_CCT=OFF -DBUILD_CS2CS=OFF -DBUILD_GEOD=OFF -DBUILD_GIE=OFF -DBUILD_PROJ=OFF -DBUILD_PROJINFO=OFF -DBUILD_PROJSYNC=OFF -DBUILD_TESTING=OFF -DENABLE_CURL=OFF -DEXE_SQLITE3=/home/jeff/Projets/Unreal/Libraries/sqlite/sqlite3 -DSQLITE3_INCLUDE_DIR=/home/jeff/Projets/Unreal/Libraries/sqlite -DTIFF_INCLUDE_DIR=/home/jeff/Projets/Unreal/Libraries/tiff-4.2.0/libtiff
        • make + copy generated static lib in GeoCoordinates plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants