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

Compiling Error on Ubuntu 16.04 #6

Closed
apenngrace opened this issue Jun 13, 2017 · 15 comments
Closed

Compiling Error on Ubuntu 16.04 #6

apenngrace opened this issue Jun 13, 2017 · 15 comments

Comments

@apenngrace
Copy link

Under Ubuntu 16.04, I get this error when running the make command.

/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
Makefile:1356: recipe for target 'src/gpujpeg_huffman_gpu_encoder.cu.o' failed
make[2]: *** [src/gpujpeg_huffman_gpu_encoder.cu.o] Error 1
make[2]: Leaving directory '/home/andrew/git_code/GPUJPEG'
Makefile:887: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/andrew/git_code/GPUJPEG'
Makefile:491: recipe for target 'all' failed
make: *** [all] Error 2
@MartinPulec
Copy link
Collaborator

MartinPulec commented Jun 13, 2017 via email

@apenngrace
Copy link
Author

apenngrace commented Jun 13, 2017 via email

@apenngrace
Copy link
Author

Unfortunately, that also fails:

NVCCFLAGS=-D_FORCE_INLINES ./autogen.sh
Makefile.am:86: warning: '%'-style pattern rules are a GNU make extension
Makefile.am:89: warning: '%'-style pattern rules are a GNU make extension
Makefile.am:93: warning: '%'-style pattern rules are a GNU make extension
Makefile.am:97: warning: '%'-style pattern rules are a GNU make extension
test/memcheck/Makefile.am:10: warning: deprecated feature: target 'memcheck' overrides 'memcheck$(EXEEXT)'
test/memcheck/Makefile.am:10: change your target to read 'memcheck$(EXEEXT)'
/usr/share/automake-1.15/am/program.am: target 'memcheck$(EXEEXT)' was defined here
test/memcheck/Makefile.am:5:   while processing program 'memcheck'
test/memcheck/Makefile.am:20: warning: deprecated feature: target 'memcheck_cuda.sh' overrides 'memcheck_cuda.sh$(EXEEXT)'
test/memcheck/Makefile.am:20: change your target to read 'memcheck_cuda.sh$(EXEEXT)'
/usr/share/automake-1.15/am/program.am: target 'memcheck_cuda.sh$(EXEEXT)' was defined here
test/memcheck/Makefile.am:4:   while processing program 'memcheck_cuda.sh'
test/memcheck/Makefile.am:13: warning: deprecated feature: target 'memcheck_local.sh' overrides 'memcheck_local.sh$(EXEEXT)'
test/memcheck/Makefile.am:13: change your target to read 'memcheck_local.sh$(EXEEXT)'
/usr/share/automake-1.15/am/program.am: target 'memcheck_local.sh$(EXEEXT)' was defined here
test/memcheck/Makefile.am:4:   while processing program 'memcheck_local.sh'
test/opengl_interop/Makefile.am:28: warning: '%'-style pattern rules are a GNU make extension
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/home/andrew/git_code/GPUJPEG':
configure: error: C compiler cannot create executables
See `config.log' for more details
Autogen failed.
andrew GPUJPEG$ gcc
gcc: fatal error: no input files
compilation terminated.

@MartinPulec
Copy link
Collaborator

MartinPulec commented Jun 13, 2017 via email

@apenngrace
Copy link
Author

apenngrace commented Jun 13, 2017 via email

@apenngrace
Copy link
Author

Ok, after I installed clang, then I can run NVCCFLAGS=-D_FORCE_INLINES ./autogen.sh and make successfully.

@athirasivaraj
Copy link

where to input the command NVCCFLAGS=-D_FORCE_INLINES ./autogen.sh ???

@MartinPulec
Copy link
Collaborator

MartinPulec commented Mar 28, 2018

@athirasivaraj Those NVCCFLAGS are flags that autogen.sh passes to nvcc compiler, autogen.sh just calls configure script. If you use another build system (MSVC, cmake) you need to pass -D_FORCE_INLINES to nvcc.

@xrucka
Copy link
Collaborator

xrucka commented Mar 29, 2018

@athirasivaraj :

Hi, I've look to our buildsystem, to see how the OBS builds gpujpeg. It's true that we do not call autogen with NVCCFLAGS, rather than patch the configure - see https://github.com/CESNET/GPUJPEG/blob/master/package_specs/ubuntu-1604-nvcc-compat.patch for details.

@athirasivaraj
Copy link

screenshot from 2018-03-29 11-27-17
iam attaching a screenshot. will this has any relation with nvcc..

@xrucka
Copy link
Collaborator

xrucka commented Mar 29, 2018

@athirasivaraj This has no relation with nvcc. Apparently, sds++ is not reachable from directories listed in your PATH variable. You can confirm this hypothesis with command which sds++ .

@athirasivaraj
Copy link

ohk ... bt what should i do to rectify this issue as iam starting from the scrap and getting no idea..

@xrucka
Copy link
Collaborator

xrucka commented Mar 30, 2018

@athirasivaraj : Things like this are Linux usage & programming basics, which you can look up in any Linux user guide and/or stackoverflow. As this "issues" are not related to our project at all, rather than basic usage, I'm closing this issue.

P.S. A fine book on linux programming: https://www.amazon.com/Beginning-Linux-Programming/dp/1861002971

P.S. The unrelated posts to the original problem will be deleted in about a week.

@xrucka xrucka closed this as completed Mar 30, 2018
@DanevenChin
Copy link

Hello, thank you very much for the code you shared.
I also encountered problems when compiling, as shown below

(lffd) qindanfeng@ubuntu:~/work/deep_learning/GPUJPEG$ cmake . -Bbuild
-- CUDA: 9.1
CMake Warning (dev) at /usr/local/share/cmake-3.13/Modules/FindOpenGL.cmake:270 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:16 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY) 
-- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/qindanfeng/work/deep_learning/GPUJPEG/build
(lffd) qindanfeng@ubuntu:~/work/deep_learning/GPUJPEG$ cmake --build build
[  5%] Building CXX object CMakeFiles/gpujpeg.dir/src/utils/image_delegate.cpp.o
In file included from /home/qindanfeng/work/deep_learning/GPUJPEG/src/utils/image_delegate.cpp:31:0:
/home/qindanfeng/work/deep_learning/GPUJPEG/src/utils/pam.hpp:48:1: error: expected unqualified-id before ‘[’ token
 [[maybe_unused]] static bool pam_read(const char *filename, unsigned int *width, unsigned int *height, in
 ^
CMakeFiles/gpujpeg.dir/build.make:838: recipe for target 'CMakeFiles/gpujpeg.dir/src/utils/image_delegate.cpp.o' failed
make[2]: *** [CMakeFiles/gpujpeg.dir/src/utils/image_delegate.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/gpujpeg.dir/all' failed
make[1]: *** [CMakeFiles/gpujpeg.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
(lffd) qindanfeng@ubuntu:~/work/deep_learning/GPUJPEG$ nvcc -I. -Xcompiler -fPIC -o gpujpeg.so --shared src/gpujpeg_*c src/gpujpeg*cu # library
(lffd) qindanfeng@ubuntu:~/work/deep_learning/GPUJPEG$ nvcc -I -o gpujpeg src/*c src/*cu # console application
nvcc fatal   : Don't know what to do with 'gpujpeg'

How to solve it?

@MartinPulec
Copy link
Collaborator

Hi @DanevenChin, I've pushed a compatibility macro for older compilers. Next time please open a new issue if not referring exactly the same problem as in the original issue.

Thanks,
Martin

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

5 participants