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

Build Errors on Ubuntu 20.04 #29

Closed
josephbburg opened this issue Jun 26, 2020 · 6 comments
Closed

Build Errors on Ubuntu 20.04 #29

josephbburg opened this issue Jun 26, 2020 · 6 comments

Comments

@josephbburg
Copy link

josephbburg commented Jun 26, 2020

Hello, I am trying to build OpenMeshEffectForBlender, and I am encountering build errors. I have two build logs with the same error, and the error occurs when trying to build with Cmake or ninja.

NOTE: I don't have any trouble building Blender's master branch with ninja.
My OpenMeshEffectForBlender repo is in the same folder ("~/blender-git") as my blender repo, so that they both use the same svn dependencies library. I attempted to build it with make and also by generating the project in its own directory and building it there with ninja and make. They all have the same error, it seems.

Here's a log file:

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_cf31e/fast && /usr/bin/make -f CMakeFiles/cmTC_cf31e.dir/build.make CMakeFiles/cmTC_cf31e.dir/build
make[1]: Entering directory '/home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_cf31e.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_cf31e.dir/src.c.o   -c /home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_cf31e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cf31e.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD   -static-libstdc++  CMakeFiles/cmTC_cf31e.dir/src.c.o  -o cmTC_cf31e 
/usr/bin/ld: CMakeFiles/cmTC_cf31e.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x63): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_cf31e.dir/build.make:87: cmTC_cf31e] Error 1
make[1]: Leaving directory '/home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_cf31e/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_da829/fast && /usr/bin/make -f CMakeFiles/cmTC_da829.dir/build.make CMakeFiles/cmTC_da829.dir/build
make[1]: Entering directory '/home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_da829.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_da829.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_da829
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_da829.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create   -static-libstdc++  CMakeFiles/cmTC_da829.dir/CheckFunctionExists.c.o  -o cmTC_da829  -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_da829.dir/build.make:87: cmTC_da829] Error 1
make[1]: Leaving directory '/home/theangerspecialist/blender-git/omfx_blender/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_da829/fast] Error 2



Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Determining if the C compiler works failed with the following output:

I'd appreciate any help fixing this error. I've already tried the svn cleanup and update that resolved another user's issues.

Thanks!

@eliemichel
Copy link
Owner

eliemichel commented Jun 27, 2020

Hi @josephbburg
Is this the full log? It really ends with "the following output:" and nothing after? And there might relevant error messages before this too if it is not the beginning of the log, cause this part is related to determining whether to use libpthread or libpthreads (with an 's') but should not be fatal.

edit: I just tried on a fresh Ubuntu 18.04 virtual machine without any trouble, the build is now available here: https://github.com/eliemichel/OpenMeshEffectForBlender/releases/tag/v0.9.0-rc1

@josephbburg
Copy link
Author

josephbburg commented Jun 27, 2020

ECMakeError.log
That's CMakeError.log, that I posted above (the end is a little weird, now that I look at it).

CMakeOutput.log
There's CMakeOutput.log

I am using Kubuntu 20.04, so I don't know if it should work on a newer OS if it works on 18.04.

Is it possible that OpenMeshEffects needs a specific compiler or a specific version of gcc? I have had builds fail for things because of gcc version in the past, and I've used update-alternatives to fix the problem.

Will try a build again today and edit this post with details if anything new happens.

EDIT: Very odd; but deleting the whole thing (build and source), then copying the libraries and re-cloning the repo in another location seems to resolve the issue... maybe I did something stupid when I initially set up the repository...
Eh, it builds but it fails in install now.
CMakeError.log
Still getting the same error, though -- undefined references to pthread functions. Am I missing a dependency somehow?

I wonder if it failed earlier the first time because I cloned the repo in my repos folder, then copied it into my Blender folder (and maybe at that point I forgot to sudo or something).

Is it safe to build the master branch of this, with the 2.90 features, or is it only successful to build the release candidate tag? Is there a specific revision of the SVN library I need to checkout?

@eliemichel
Copy link
Owner

I think that these pthread errors are not important, it's just that with some versions of GCC it's lpthreads and for others its lpthreads so it tries both. In you case, it fails with lpthreads so then it uses lpthread.

What you need to build from this repo is the openmesheffect branch or tag mfx-v0.9.0-rc1. In either cases, it is based on 2.83 LTS, not on 2.90 for now (once you'll succeed at building, porting to 2.90 is not so complicated though, but one thing at a time). Nothing special about the svn library, when I did it yesterday I used the last version of the building instructions.

Could you share the console log that you have when calling make? You say it fails at installing, do you mean when calling make install? What's the log of the command that fails? It seems that the cmake part ran all right, the issues come from the make part.

@josephbburg
Copy link
Author

josephbburg commented Jun 28, 2020

terminal-output.log
Here is the result of running make | tee terminal-output.log
Since I'd already compiled all the code, it doesn't show any of the error or warning messages. I think it fails when it tries to link the CXX objects together? I don't have any formal training in programming.

After that, there's more in the terminal that wasn't caught by tee (oddly):

CMake Error at source/creator/cmake_install.cmake:53 (file):
  file INSTALL cannot find
  "/home/theangerspecialist/Documents/repos/OMFX_Blender/OpenMeshEffectForBlender/release/datafiles/locale/languages":
  No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:45 (include)


make[1]: *** [Makefile:108: install] Error 1
make: *** [GNUmakefile:315: all] Error 2

Will now try deleting the build_linux folder and doing it with ninja instead. I will edit this when I have done so.

Edit: Same result.
terminal-output.log
With the same part at the end, after the point where tee left off:

CMake Error at source/creator/cmake_install.cmake:53 (file):
  file INSTALL cannot find
  "/home/theangerspecialist/Documents/repos/OMFX_Blender/OpenMeshEffectForBlender/release/datafiles/locale/languages":
  No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:45 (include)


FAILED: CMakeFiles/install.util 
cd /home/theangerspecialist/Documents/repos/OMFX_Blender/build_linux && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
make: *** [GNUmakefile:315: all] Error 1

Anyways, I think we are in very different time zones. It is now very late at night for me, so late that it's almost morning! I will try a few things after I wake in about 8 hours. The "no such file or folder" thing is suspicious, and I bet it's easy enough to fix.
Thanks.

@eliemichel
Copy link
Owner

Ok it built correctly it's just missing the submodules for language files and addons, so try running git submodule update --init --recursive from within the directory in which you cloned this git repository.

Have a good night then. ^^

PS: There is more in the terminal than in the log file because the pipe, and hence the tee only catches stdout, not stderr. To log both streams, you can add 2>&1 between make and | tee to mean "redirect stderr to the same thing as stdout" (or since bash 4 just replace | with |&).

@josephbburg
Copy link
Author

Interesting. I ran make update from the directory the first time I tried to build and I thought it did the submodules?

Anyways, the build works now. Thanks! Time to start playing around with Open Mesh Effects!

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

No branches or pull requests

2 participants