I am a newbie in CUDA and want to compile my first programms on a Jetson TK1.
I have searched the Internet and also this Site but dont found something, that was helpful for me.
I have found this example
http://bikulov.org/blog/2013/12/24/example-of-cmake-file-for-cuda-plus-cpp-code/
and tried to compile the CUDA example oceanFFT which runs with the sample Makefile.
http://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_website/samples.html#oceanFFT
I have changed this CMakeLists.txt a little bit, but I dont know if I did this correct.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
INCLUDE_DIRECTORIES(/usr/local/cuda/include ${MPI_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/inc ${CUS_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/lib/linux/armv7l ${GLEW_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
TARGET_LINK_LIBRARIES(lbmslv /usr/local/cuda/lib/libcudart.so ${MPI_LIBRARIES})
When I run this I get a lot errors with :
undefined reference to .. gl.., glew.., glut..
so, not linked to this Libraries.
What did I wrong?
My problem with the sample Makefiles is, that they are to complicate for my.
I have also tried to make the sample Makefile easier.
# Location of the CUDA Toolkit
CUDA_PATH ?= /usr/local/cuda-6.5
OSUPPER = $(shell uname -s 2>/dev/null | tr "[:lower:]" "[:upper:]")
OSLOWER = $(shell uname -s 2>/dev/null | tr "[:upper:]" "[:lower:]")
OS_SIZE = $(shell uname -m | sed -e "s/x86_64/64/" -e "s/armv7l/32/" -e "s/aarch64/64/")
OS_ARCH = $(shell uname -m)
ARCH_FLAGS =
DARWIN = $(strip $(findstring DARWIN, $(OSUPPER)))
ifneq ($(DARWIN),)
XCODE_GE_5 = $(shell expr `xcodebuild -version | grep -i xcode | awk '{print $$2}' | cut -d'.' -f1` \>= 5)
endif
# Take command line flags that override any of these settings
# ARCH == ARMv7
OS_SIZE = 32
OS_ARCH = armv7l
ARCH_FLAGS = -target-cpu-arch ARM
# Common binaries
GCC := arm-linux-gnueabihf-g++
NVCC := $(CUDA_PATH)/bin/nvcc -ccbin $(GCC)
# internal flags
NVCCFLAGS := -m${OS_SIZE} ${ARCH_FLAGS}
CCFLAGS :=
LDFLAGS :=
# Extra user flags
EXTRA_NVCCFLAGS ?=
EXTRA_LDFLAGS ?=
EXTRA_CCFLAGS ?=
# OS-specific build flags
ifeq ($(abi),gnueabi)
CCFLAGS += -mfloat-abi=softfp
else
# default to gnueabihf
override abi := gnueabihf
LDFLAGS += --dynamic-linker=/lib/ld-linux-armhf.so.3
CCFLAGS += -mfloat-abi=hard
endif
ifneq ($(TARGET_FS),)
GCCVERSIONLTEQ46 := $(shell expr `$(GCC) -dumpversion` \<= 4.6)
ifeq ($(GCCVERSIONLTEQ46),1)
CCFLAGS += --sysroot=$(TARGET_FS)
endif
LDFLAGS += --sysroot=$(TARGET_FS)
LDFLAGS += -rpath-link=$(TARGET_FS)/lib
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib/arm-linux-$(abi)
endif
# Debug build flags
ifeq ($(dbg),1)
NVCCFLAGS += -g -G
TARGET := debug
else
TARGET := release
endif
ALL_CCFLAGS :=
ALL_CCFLAGS += $(NVCCFLAGS)
ALL_CCFLAGS += $(EXTRA_NVCCFLAGS)
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(CCFLAGS))
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(EXTRA_CCFLAGS))
ALL_LDFLAGS :=
ALL_LDFLAGS += $(ALL_CCFLAGS)
ALL_LDFLAGS += $(addprefix -Xlinker ,$(LDFLAGS))
ALL_LDFLAGS += $(addprefix -Xlinker ,$(EXTRA_LDFLAGS))
# Common includes and paths for CUDA
INCLUDES := -I ~/NVIDIA_CUDA-6.5_Samples/common/inc
LIBRARIES :=
################################################################################
SAMPLE_ENABLED := 1
# Makefile include to help find GL Libraries
include ./findgllib.mk
# OpenGL specific libraries
ifneq ($(DARWIN),)
# Mac OSX specific libraries and paths to include
LIBRARIES += -L/System/Library/Frameworks/OpenGL.framework/Libraries
LIBRARIES += -lGL -lGLU ../../common/lib/darwin/libGLEW.a
ALL_LDFLAGS += -Xlinker -framework -Xlinker GLUT
else
LIBRARIES += -L ~/NVIDIA_CUDA-6.5_Samples/common/lib/$(OSLOWER)/$(OS_ARCH) $(GLLINK)
LIBRARIES += -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW
endif
# Gencode arguments
ifeq ($(OS_ARCH),armv7l)
SMS ?= 20 30 32 35 37 50 52
else
SMS ?= 11 20 30 35 37 50 52
endif
ifeq ($(SMS),)
$(info >>> WARNING - no SM architectures have been specified - waiving sample <<<)
SAMPLE_ENABLED := 0
endif
ifeq ($(GENCODE_FLAGS),)
# Generate SASS code for each SM architecture listed in $(SMS)
$(foreach sm,$(SMS),$(eval GENCODE_FLAGS += -gencode arch=compute_$(sm),code=sm_$(sm)))
# Generate PTX code from the highest SM architecture in $(SMS) to guarantee forward-compatibility
HIGHEST_SM := $(lastword $(sort $(SMS)))
ifneq ($(HIGHEST_SM),)
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM)
endif
endif
LIBRARIES += -lcufft
ifeq ($(SAMPLE_ENABLED),0)
EXEC ?= #echo "[#]"
endif
################################################################################
# Target rules
all: build
build: dat
check.deps:
ifeq ($(SAMPLE_ENABLED),0)
#echo "Sample will be waived due to the above missing dependencies"
else
#echo "Sample is ready - all dependencies have been met"
endif
dat.o:oceanFFT.cpp
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $# -c $<
dat_kernel.o:oceanFFT_kernel.cu
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $# -c $<
dat: dat.o dat_kernel.o
$(EXEC) $(NVCC) $(ALL_LDFLAGS) $(GENCODE_FLAGS) -o $# $+ $(LIBRARIES)
$(EXEC) mkdir -p ../bin
$(EXEC) cp $# ../bin
run: build
$(EXEC) ./dat
clean:
rm -f dat dat.o dat_kernel.o
rm -rf ../bin/dat
clobber: clean
Is their anything else, I can make easier or shorter?
I have less experience in creating makefiles and looking for a general way to create some for CUDA. I hope you can help me.
EDIT:
The new cmake file is:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
# include every include directory
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} ${GLEW_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/inc ${SAMPLE_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
# add every dependency to lbmslv
TARGET_LINK_LIBRARIES(lbmslv ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES} ${SAMPLE_LIBRARIES})
I get the following terminal outputs:
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$ cmake ../myOzean/
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CUDA: /usr/local/cuda-6.5 (found version "6.5")
-- Found MPI_C: /usr/lib/libmpi.so;/usr/lib/arm-linux-gnueabihf/libdl.so;/usr/lib/arm-linux-gnueabihf/libhwloc.so
-- Found MPI_CXX: /usr/lib/libmpi_cxx.so;/usr/lib/libmpi.so;/usr/lib/arm-linux-gnueabihf/libdl.so;/usr/lib/arm-linux-gnueabihf/libhwloc.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
-- Found OpenGL: /usr/lib/arm-linux-gnueabihf/libGL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Documents/CUDA/bin
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$ make
[ 50%] Building NVCC (Device) object CMakeFiles/lbmslv.dir//./lbmslv_generated_oceanFFT_kernel.cu.o
/usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stddef.h(432): error: identifier "nullptr" is undefined
/usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stddef.h(432): error: expected a ";"
/usr/include/arm-linux-gnueabihf/c++/4.8/bits/c++config.h(190): error: expected a ";"
/usr/include/c++/4.8/exception(63): error: expected a ";"
/usr/include/c++/4.8/exception(68): error: expected a ";"
/usr/include/c++/4.8/exception(76): error: expected a ";"
/usr/include/c++/4.8/exception(83): error: expected a ";"
/usr/include/c++/4.8/exception(93): error: expected a "{"
/usr/include/c++/4.8/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"
/usr/include/c++/4.8/bits/exception_ptr.h(64): error: expected a "{"
/usr/include/c++/4.8/bits/exception_ptr.h(79): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(81): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(82): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(84): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: declaration is incompatible with previous "std::current_exception"
(64): here
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(87): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(90): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(92): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(95): error: incomplete type is not allowed
/usr/include/c++/4.8/bits/exception_ptr.h(95): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(116): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(126): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(143): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(144): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(147): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(152): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(153): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(156): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(157): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(160): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(161): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(169): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(57): error: incomplete type is not allowed
/usr/include/c++/4.8/bits/nested_exception.h(60): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(66): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(70): error: identifier "rethrow_exception" is undefined
/usr/include/c++/4.8/bits/nested_exception.h(73): error: function "std::nested_exception::nested_ptr" returns incomplete type "std::__exception_ptr::exception_ptr"
/usr/include/c++/4.8/new(95): error: expected a "{"
/usr/include/c++/4.8/new(110): error: identifier "__p" is undefined
/usr/include/c++/4.8/new(111): error: expected a "{"
/usr/include/c++/4.8/new(115): error: expected a "{"
/usr/include/c++/4.8/new(116): error: expected a "{"
/usr/local/cuda-6.5/include/common_functions.h(92): warning: exception specification is incompatible with that of previous function "operator new[](std::size_t, void *)"
/usr/include/c++/4.8/new(111): here
/usr/local/cuda-6.5/include/common_functions.h(93): warning: exception specification is incompatible with that of previous function "operator delete(void *, void *)"
/usr/include/c++/4.8/new(115): here
/usr/local/cuda-6.5/include/common_functions.h(94): warning: exception specification is incompatible with that of previous function "operator delete[](void *, void *)"
/usr/include/c++/4.8/new(116): here
/usr/include/c++/4.8/bits/cpp_type_traits.h(184): error: identifier "char16_t" is undefined
/usr/include/c++/4.8/bits/cpp_type_traits.h(191): error: identifier "char32_t" is undefined
/usr/include/c++/4.8/bits/cpp_type_traits.h(191): error: class "std::__is_integer<<error-type>>" has already been defined
/usr/include/c++/4.8/bits/cpp_type_traits.h(314): error: namespace "std::__gnu_cxx" has no member "__normal_iterator"
/usr/include/c++/4.8/bits/cpp_type_traits.h(314): error: expected a ">"
/usr/include/c++/4.8/cmath(80): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(80): error: expected a ";"
/usr/include/c++/4.8/cmath(105): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(105): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(105): error: expected a ";"
/usr/include/c++/4.8/cmath(124): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(124): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(124): error: expected a ";"
/usr/include/c++/4.8/cmath(143): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(143): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(143): error: expected a ";"
/usr/include/c++/4.8/cmath(162): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(162): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(162): error: expected a ";"
/usr/include/c++/4.8/cmath(183): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(183): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(183): error: expected a ";"
/usr/include/c++/4.8/cmath(202): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(202): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(202): error: expected a ";"
/usr/include/c++/4.8/cmath(221): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(221): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(221): error: expected a ";"
/usr/include/c++/4.8/cmath(240): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(240): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(240): error: expected a ";"
/usr/include/c++/4.8/cmath(259): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(259): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(259): error: expected a ";"
/usr/include/c++/4.8/cmath(278): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(278): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(278): error: expected a ";"
/usr/include/c++/4.8/cmath(297): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(297): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(297): error: expected a ";"
/usr/include/c++/4.8/cmath(328): error: "constexpr" is not a function or static data member
/usr/include/c++/4.8/cmath(337): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(337): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(337): error: expected a ";"
/usr/include/c++/4.8/cmath(356): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(356): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(356): error: expected a ";"
/usr/include/c++/4.8/cmath(375): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(375): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(375): error: expected a ";"
/usr/include/c++/4.8/cmath(406): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(406): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(406): error: expected a ";"
/usr/include/c++/4.8/cmath(443): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(443): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(443): error: expected a ";"
Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00004dfc_00000000-12_oceanFFT_kernel.compute_35.cpp1.ii".
Compilation terminated.
CMake Error at lbmslv_generated_oceanFFT_kernel.cu.o.cmake:264 (message):
Error generating file
/home/ubuntu/Documents/CUDA/bin/CMakeFiles/lbmslv.dir//./lbmslv_generated_oceanFFT_kernel.cu.o
make[2]: *** [CMakeFiles/lbmslv.dir/./lbmslv_generated_oceanFFT_kernel.cu.o] Error 1
make[1]: *** [CMakeFiles/lbmslv.dir/all] Error 2
make: *** [all] Error 2
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$
I've changed your CMakeLists.txt a little bit:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
# include every include directory
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} ${MPI_INCLUDE_PATH} ${GLEW_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
# add every dependency to lbmslv
TARGET_LINK_LIBRARIES(lbmslv ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES})
Related
I am trying to compile vasp 6.2.1 in my ubuntu 19.10 on VirtualBox. I have intel openApi (which has ifortran compiler) and fftw3 installed. I am trying to compile the serial version using ifort. But it's giving me an error as follows.
if [ ! -d build ] ; then mkdir build ; fi
if [ ! -d build/std ] ; then mkdir build/std ; fi
cp src/makefile src/.objects src/makedeps.awk makefile.include build/std
make -C build/std VERSION=std cleandependencies -j1
make[1]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
rm -f .depend
make[1]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
make -C build/std VERSION=std all
make[1]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
rsync -ru ../../src/lib .
cp makefile.include lib
make -C lib -j1
make[2]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/lib'
make libdmy.a
make[3]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/lib'
make[3]: 'libdmy.a' is up to date.
make[3]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/lib'
make[2]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/lib'
rsync -ru ../../src/parser .
cp makefile.include parser
make -C parser -j1
make[2]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/parser'
make libparser.a
make[3]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/parser'
make[3]: 'libparser.a' is up to date.
make[3]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/parser'
make[2]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std/parser'
rsync -u ../../src/*.F ../../src/*.inc .
rm -f vasp ; make vasp ; cp vasp ../../bin/vasp_std
make[2]: Entering directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
mpiifort -qmkl=cluster -lstdc++ -o vasp c2f_interface.o nccl2for.o simd.o base.o profiling.o string.o tutor.o version.o vhdf5_base.o incar_reader.o reader_base.o openmp.o openacc_struct.o mpi.o mpi_shmem.o mathtools.o hamil_struct.o radial_struct.o pseudo_struct.o mgrid_struct.o wave_struct.o nl_struct.o mkpoints_struct.o poscar_struct.o afqmc_struct.o phonon_struct.o fock_glb.o chi_glb.o smart_allocate.o xml.o extpot_glb.o constant.o vdwforcefield_glb.o jacobi.o main_mpi.o openacc.o scala.o asa.o lattice.o poscar.o ini.o mgrid.o setex_struct.o xclib.o vdw_nl.o xclib_grad.o setex.o radial.o pseudo.o gridq.o ebs.o symlib.o mkpoints.o random.o wave.o wave_mpi.o wave_high.o bext.o spinsym.o symmetry.o lattlib.o nonl.o nonlr.o nonl_high.o dfast.o choleski2.o mix.o hamil.o xcgrad.o xcspin.o potex1.o potex2.o constrmag.o cl_shift.o relativistic.o LDApU.o paw_base.o metagga.o egrad.o pawsym.o pawfock.o pawlhf.o diis.o rhfatm.o hyperfine.o fock_ace.o paw.o mkpoints_full.o charge.o Lebedev-Laikov.o stockholder.o dipol.o solvation.o scpc.o pot.o tet.o dos.o elf.o hamil_rot.o chain.o dyna.o fileio.o vhdf5.o sphpro.o us.o core_rel.o aedens.o wavpre.o wavpre_noio.o broyden.o dynbr.o reader.o writer.o xml_writer.o brent.o stufak.o opergrid.o stepver.o chgloc.o fast_aug.o fock_multipole.o fock.o fock_dbl.o fock_frc.o mkpoints_change.o subrot_cluster.o sym_grad.o mymath.o npt_dynamics.o subdftd3.o subdftd4.o internals.o dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcefield.o nmr.o pead.o k-proj.o subrot.o subrot_scf.o paircorrection.o rpa_force.o ml_interface.o force.o pwlhf.o gw_model.o optreal.o steep.o rmm-diis.o davidson.o david_inner.o root_find.o lcao_bare.o locproj.o electron_common.o electron.o rot.o electron_all.o shm.o pardens.o optics.o constr_cell_relax.o stm.o finite_diff.o elpol.o hamil_lr.o rmm-diis_lr.o subrot_lr.o lr_helper.o hamil_lrf.o elinear_response.o ilinear_response.o linear_optics.o setlocalpp.o wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o gauss_quad.o m_unirnk.o minimax_ini.o minimax_dependence.o minimax_functions1D.o minimax_functions2D.o minimax_struct.o minimax_varpro.o minimax.o mlwf.o ratpol.o pade_fit.o screened_2e.o wave_cacher.o crpa.o chi_base.o wpot.o local_field.o ump2.o ump2kpar.o fcidump.o ump2no.o bse_te.o bse.o time_propagation.o acfdt.o afqmc.o rpax.o chi.o acfdt_GG.o dmft.o GG_base.o greens_orbital.o lt_mp2.o rnd_orb_mp2.o greens_real_space.o chi_GG.o chi_super.o sydmat.o rmm-diis_mlr.o linear_response_NMR.o wannier_interpol.o wave_interpolate.o linear_response.o auger.o dmatrix.o phonon.o wannier_mats.o elphon.o core_con_mat.o embed.o extpot.o fft3dfurth.o fft3dlib.o main.o -Llib -ldmy -Lparser -lparser -Lparser -lparser -lstdc++
ipo: warning #11021: unresolved fftext_mu_
Referenced in /tmp/ipo_ifortQlEAwA.o
ipo: warning #11021: unresolved fftext_useinv_mu_
Referenced in /tmp/ipo_ifortQlEAwA.o
ipo: warning #11021: unresolved fftwav_mu_
Referenced in /tmp/ipo_ifortQlEAwA.o
ipo: warning #11021: unresolved fftwav_useinv_mu_
Referenced in /tmp/ipo_ifortQlEAwA.o
ld: /tmp/ipo_ifortQlEAwA2.o: in function `wave_high_mp_fftext_wa_':
ipo_out2.f:(.text.hot00012+0x2d442): undefined reference to `fftext_useinv_mu_'
ld: ipo_out2.f:(.text.hot00012+0x2d597): undefined reference to `fftext_mu_'
ld: /tmp/ipo_ifortQlEAwA2.o: in function `wave_high_mp_fftwav_wa_':
ipo_out2.f:(.text.hot00012+0x2d865): undefined reference to `fftwav_useinv_mu_'
ld: ipo_out2.f:(.text.hot00012+0x2d99f): undefined reference to `fftwav_mu_'
make[2]: *** [makefile:149: vasp] Error 1
make[2]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:146: all] Error 1
make[1]: Leaving directory '/home/mdazharul/vasp/vasp6.2.1/vasp6.2.1/vasp6.2.1/vasp.6.2.1/build/std'
make: *** [makefile:17: std] Error 2
I am Also including the makefile.include.
>
# Precompiler options
CPP_OPTIONS= -DHOST=\"LinuxIFC\"\
-DCACHE_SIZE=16000 \
-Davoidalloc \
-Duse_bse_te \
-Dtbdyn \
-Dfock_dblbuf
CPP = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)
FC = mpiifort
FCL = mpiifort -qmkl=cluster -lstdc++
FREE = -free -names lowercase
FFLAGS = -assume byterecl -w -xHOST
OFLAG = -O2
OFLAG_IN = $(OFLAG)
DEBUG = -O0
MKL_PATH = $(MKLROOT)/lib/intel64
BLAS =
LAPACK =
BLACS =
SCALAPACK =
OBJECTS = fft3dfurth.o fft3dlib.o
INCS =-I$(MKLROOT)/include/fftw
LLIBS = $(SCALAPACK) $(LAPACK) $(BLAS)
OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o
# For what used to be vasp.5.lib
CPP_LIB = $(CPP)
FC_LIB = $(FC)
CC_LIB = icc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB = $(FREE)
OBJECTS_LIB= linpack_double.o
# For the parser library
CXX_PARS = icpc
LLIBS += -Lparser -lparser -lstdc++
# Normally no need to change this
SRCDIR = ../../src
BINDIR = ../../bin
I can not seem to locate the problem. Please help me regarding this matter. Thank you.
`
You can try compiling your application using mpiifort instead of doing it with ifort compiler. You are getting the undefined reference to `MPI_Comm_rank errors because your application did not get linked with the MPI libraries. mpiifort compiler uses intel ifort compiler along with MPI wrappers.
I am currently setting up a new PC with Omnet++, Veins and Artery for simulating ITS-G5 protocol. After calling make inet in the root directory of Artery I get the following Error Message:
$ make inet
cd extern/inet; python inet_featuretool disable packetdrill SCTP SCTP_examples
Disabling feature(s): packetdrill, SCTP_examples, SCTP
opp_featuretool: .oppfeaturestate file updated.
opp_featuretool: .nedexclusions file updated.
make -C extern/inet makefiles
make[1]: Entering directory '/home/wiconlab/Car2x/artery-master/extern/inet'
Creating Makefile in /home/wiconlab/Car2x/artery-master/extern/inet/src...
make[1]: Leaving directory '/home/wiconlab/Car2x/artery-master/extern/inet'
make -C extern/inet/src
make[1]: Entering directory '/home/wiconlab/Car2x/artery-master/extern/inet/src'
*** COMPILING with:
g++ -c -std=c++11 -O3 -march=native -mtune=native -DNDEBUG=1 -MMD -MP -MF .d -fPIC -fno-stack-protector -DHAVE_SWAPCONTEXT -DWITH_MPI -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_TKENV -DWITH_PARSIM -DWITH_NETBUILDER -DWITH_OSG -DWITH_OSGEARTH -Wno-overloaded-virtual -include inet/common/precompiled.h -I. -I/home/wiconlab/Car2x/omnetpp-5.2/include
*** LINKING with:
g++ -shared -fPIC -o ../out/gcc-release/src/libINET.so -Wl,--no-as-needed -Wl,--whole-archive -Wl,--no-whole-archive -loppenvir -loppsim -ldl -lstdc++ -lOpenThreads -losg -losgText -losgDB -losgEarth -losgEarthUtil -Wl,-rpath,/home/wiconlab/Car2x/omnetpp-5.2/lib -Wl,-rpath,/lib -Wl,-rpath,. -L/home/wiconlab/Car2x/omnetpp-5.2/lib
Building...
Creating precompiled header for gcc...
MSGC: inet/applications/base/ApplicationPacket.msg
... *ABBREVIATED FOR CLARITY*
inet/networklayer/ipv4/RoutingTableRecorder.cc
inet/networklayer/ipv4/RoutingTableRecorder.cc: In member function ‘virtual void inet::RoutingTableRecorder::recordInterfaceChange(omnetpp::cModule*, const inet::InterfaceEntry*, omnetpp::simsignal_t)’:
inet/networklayer/ipv4/RoutingTableRecorder.cc:207:15: error: expected ‘)’ before ‘INT64_PRINTF_FORMAT’
#define LL INT64_PRINTF_FORMAT // for eventnumber_t
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:296:37: note: in expansion of macro ‘LL’
fprintf(routingLogFile, "%s %" LL "d %s %d %s %s\n",
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:303:13: warning: spurious trailing ‘%’ in format [-Wformat=]
);
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:303:13: warning: too many arguments for format [-Wformat-extra-args]
inet/networklayer/ipv4/RoutingTableRecorder.cc: In member function ‘virtual void inet::RoutingTableRecorder::recordRouteChange(omnetpp::cModule*, const inet::IRoute*, omnetpp::simsignal_t)’:
inet/networklayer/ipv4/RoutingTableRecorder.cc:207:15: error: expected ‘)’ before ‘INT64_PRINTF_FORMAT’
#define LL INT64_PRINTF_FORMAT // for eventnumber_t
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:323:36: note: in expansion of macro ‘LL’
fprintf(routingLogFile, "%s %" LL "d %s %d %s %s %d %s\n",
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:332:13: warning: spurious trailing ‘%’ in format [-Wformat=]
);
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:332:13: warning: too many arguments for format [-Wformat-extra-args]
Makefile:1134: recipe for target '../out/gcc-release/src/inet/networklayer/ipv4/RoutingTableRecorder.o' failed
make[1]: *** [../out/gcc-release/src/inet/networklayer/ipv4/RoutingTableRecorder.o] Error 1
make[1]: Leaving directory '/home/wiconlab/Car2x/artery-master/extern/inet/src'
Makefile:21: recipe for target 'inet' failed
make: *** [inet] Error 2
I am using an up to date Ubuntu 16.04 LTS, compiling with cmake 3.9.6, building Veins and Vanetza worked without issue. Omnet++ Version is 5.2. The code lines, the Error is referring to are:
203 namespace inet {
204
205 Define_Module(RoutingTableRecorder);
206
207 #define LL INT64_PRINTF_FORMAT // for eventnumber_t
However expecting a ")" before line 207 makes no sense to me.
Also, this Error did not appear when building Artery on a different System (Same OS) a few weeks earlier. Using an earlier revision of the source had no effect either.
You are using OMNeT++ 5.2.
This seems to be the problem because the API has changed slightly.
INT64_PRINTF_FORMAT isn't available anymore in OMNeT++ 5.2.
Changing back to OMNeT++ Version 5.1 should resolve your error!
fprintf(routingLogFile, "%s %" LL "d %s %d %s %s %d %s\n",
^
inet/networklayer/ipv4/RoutingTableRecorder.cc:332:13: warning: spurious trailing ‘%’ in format [-Wformat=]
);
This is just a simple syntax error. Go through the path Inet/src/inet/networlayer/ipv4/ and open the RoutingTableRecord.cc file and edit at "fprintf(routingLogFile, "%s %" LL "d %s %d %s %s %d %s\n", " line and remove LL including the double quotes that is around the LL. There are two of them with in this C code. So make sure they are both corrected like the following line: fprintf(routingLogFile, "%s %d %s %d %s %s %d %s\n", .
You might also need to comment out #define LL INT64_PRINTF_FORMAT // for eventnumber_t at line number around 270.
Then save and Clean only the inet project. Then Build also only the inet project.
I have taken the code from the following source on Github and am trying to run it from Qt on RHEL Red Hat 4.4.7-17:
https://github.com/neveraway/oclJPEGDecoder
I extracted the project folder and ran qmake -projectin it. I opened the files in Qt creator and further modified my .pro file to link OpenCL sources and add the CXX and CFLAGS.
My .pro file looks like this:
######################################################################
# Automatically generated by qmake (1.07a) Tue Mar 28 14:51:49 2017
######################################################################
TEMPLATE = app
DEPENDPATH += src \
/usr/local/cuda-7.0/lib64/
INCLUDEPATH += . src \
/usr/local/cuda-7.0/lib64/\
/usr/local/cuda-7.0/include/
# Input
HEADERS += src/bitstream.h \
src/bmp.h \
src/decoder.h \
src/huffman.h \
src/idct.h \
src/jpeg.h \
src/macro.h \
src/stdafx.h \
src/targetver.h \
src/zigzag.h
SOURCES += src/bitstream.cpp \
src/cpuIDCT8x8.cpp \
src/decoder.cpp \
src/huffman.cpp \
src/main.cpp \
src/oclDCT8x8.cpp \
src/parser.cpp \
src/stdafx.cpp \
src/main.cpp
LIBS += -L/usr/local/cuda-7.0/lib64/ -lOpenCL
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CFLAGS += -std=c99
DISTFILES += \
src/idct8x8.cl \
oclJPEGDecoder.sln \
oclJPEGDecoder.vcxproj \
oclJPEGDecoder.vcxproj.filters \
README.md \
test/JPEG_example_JPG_RIP_050.jpg
When I clicked on Run qmake and then Build All, this is what I saw under "Compile Output":
18:08:23: Configuration unchanged, skipping qmake step.
18:08:23: Starting: "/usr/bin/make"
Makefile:634: warning: overriding commands for target `main.o'
Makefile:603: warning: ignoring old commands for target `main.o'
g++ -c -pipe -std=c++11 -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../oclJPEGDecoder-master -I. -I../oclJPEGDecoder-master -I../oclJPEGDecoder-master/src -I/usr/local/cuda-7.0/lib64 -I/usr/local/cuda-7.0/include -I/opt/Qt5.6.2/5.6/gcc_64/include -I/opt/Qt5.6.2/5.6/gcc_64/include/QtGui -I/opt/Qt5.6.2/5.6/gcc_64/include/QtCore -I. -I/opt/Qt5.6.2/5.6/gcc_64/mkspecs/linux-g++ -o bitstream.o ../oclJPEGDecoder-master/src/bitstream.cpp
cc1plus: error: unrecognized command line option "-std=c++11"
make: *** [bitstream.o] Error 1
18:08:23: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project oclJPEGDecoder-master (kit: Desktop Qt 5.6.2 GCC 64bit)
When executing step "Make"
18:08:23: Elapsed time: 00:00.
My Makefile has the following contents:
#############################################################################
# Makefile for building: oclJPEGDecoder-master
# Generated by qmake (3.0) (Qt 5.6.2)
# Project: ../oclJPEGDecoder-master/oclJPEGDecoder-master.pro
# Template: app
# Command: /opt/Qt5.6.2/5.6/gcc_64/bin/qmake -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../oclJPEGDecoder-master/oclJPEGDecoder-master.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -std=c++11 -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I../oclJPEGDecoder-master -I. -I../oclJPEGDecoder-master -I../oclJPEGDecoder-master/src -I/usr/local/cuda-7.0/lib64 -I/usr/local/cuda-7.0/include -I/opt/Qt5.6.2/5.6/gcc_64/include -I/opt/Qt5.6.2/5.6/gcc_64/include/QtGui -I/opt/Qt5.6.2/5.6/gcc_64/include/QtCore -I. -I/opt/Qt5.6.2/5.6/gcc_64/mkspecs/linux-g++
QMAKE = /opt/Qt5.6.2/5.6/gcc_64/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = oclJPEGDecoder-master1.0.0
DISTDIR = /root/Downloads/build-oclJPEGDecoder-master-Desktop_Qt_5_6_2_GCC_64bit-Debug/.tmp/oclJPEGDecoder-master1.0.0
LINK = g++
LFLAGS = -Wl,-rpath,/opt/Qt5.6.2/5.6/gcc_64/lib
LIBS = $(SUBLIBS) -L/usr/local/cuda-7.0/lib64/ -lOpenCL -L/opt/Qt5.6.2/5.6/gcc_64/lib -lQt5Gui -L/usr/lib64 -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
My .o files look like this:
####### Compile
bitstream.o: ../oclJPEGDecoder-master/src/bitstream.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/bitstream.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o bitstream.o ../oclJPEGDecoder-master/src/bitstream.cpp
cpuIDCT8x8.o: ../oclJPEGDecoder-master/src/cpuIDCT8x8.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/idct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o cpuIDCT8x8.o ../oclJPEGDecoder-master/src/cpuIDCT8x8.cpp
decoder.o: ../oclJPEGDecoder-master/src/decoder.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/jpeg.h \
../oclJPEGDecoder-master/src/bmp.h \
../oclJPEGDecoder-master/src/bitstream.h \
../oclJPEGDecoder-master/src/huffman.h \
../oclJPEGDecoder-master/src/zigzag.h \
../oclJPEGDecoder-master/src/idct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o decoder.o ../oclJPEGDecoder-master/src/decoder.cpp
huffman.o: ../oclJPEGDecoder-master/src/huffman.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/huffman.h \
../oclJPEGDecoder-master/src/bitstream.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o huffman.o ../oclJPEGDecoder-master/src/huffman.cpp
main.o: ../oclJPEGDecoder-master/src/main.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/bitstream.h \
../oclJPEGDecoder-master/src/huffman.h \
../oclJPEGDecoder-master/src/idct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../oclJPEGDecoder-master/src/main.cpp
oclDCT8x8.o: ../oclJPEGDecoder-master/src/oclDCT8x8.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
/usr/local/cuda-7.0/include/CL/opencl.h \
/usr/local/cuda-7.0/include/CL/cl.h \
/usr/local/cuda-7.0/include/CL/cl_platform.h \
/usr/local/cuda-7.0/include/CL/cl_gl.h \
/usr/local/cuda-7.0/include/CL/cl_gl_ext.h \
/usr/local/cuda-7.0/include/CL/cl_ext.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/idct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o oclDCT8x8.o ../oclJPEGDecoder-master/src/oclDCT8x8.cpp
parser.o: ../oclJPEGDecoder-master/src/parser.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/jpeg.h \
../oclJPEGDecoder-master/src/decoder.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o parser.o ../oclJPEGDecoder-master/src/parser.cpp
stdafx.o: ../oclJPEGDecoder-master/src/stdafx.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o stdafx.o ../oclJPEGDecoder-master/src/stdafx.cpp
main.o: ../oclJPEGDecoder-master/src/main.cpp ../oclJPEGDecoder-master/src/stdafx.h \
../oclJPEGDecoder-master/src/targetver.h \
../oclJPEGDecoder-master/src/macro.h \
../oclJPEGDecoder-master/src/bitstream.h \
../oclJPEGDecoder-master/src/huffman.h \
../oclJPEGDecoder-master/src/idct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../oclJPEGDecoder-master/src/main.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
2nd ATTEMPT WITH -std=c++0x:
I changed the CXX_FLAGS command to QMAKE_CXXFLAGS += -std=c++0x and kept everything else unchanged in my .pro file.
When I clicked on Build All after making the change, this is the output I got under "Compile Output":
18:38:06: Running steps for project oclJPEGDecoder-master...
18:38:06: Configuration unchanged, skipping qmake step.
18:38:06: Starting: "/usr/bin/make"
Makefile:634: warning: overriding commands for target `main.o'
Makefile:603: warning: ignoring old commands for target `main.o'
g++ -c -pipe -std=c++0x -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../oclJPEGDecoder-master -I. -I../oclJPEGDecoder-master -I../oclJPEGDecoder-master/src -I/usr/local/cuda-7.0/lib64 -I/usr/local/cuda-7.0/include -I/opt/Qt5.6.2/5.6/gcc_64/include -I/opt/Qt5.6.2/5.6/gcc_64/include/QtGui -I/opt/Qt5.6.2/5.6/gcc_64/include/QtCore -I. -I/opt/Qt5.6.2/5.6/gcc_64/mkspecs/linux-g++ -o bitstream.o ../oclJPEGDecoder-master/src/bitstream.cpp
In file included from ../oclJPEGDecoder-master/src/bitstream.cpp:4:
../oclJPEGDecoder-master/src/bitstream.h:368: error: 'nullptr' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h:368: error: ISO C++ forbids initialization of member 'mBitReservoir'
../oclJPEGDecoder-master/src/bitstream.h:368: error: making 'mBitReservoir' static
../oclJPEGDecoder-master/src/bitstream.h:368: error: invalid in-class initialization of static data member of non-integral type 'uint8_t*'
../oclJPEGDecoder-master/src/bitstream.h:369: error: ISO C++ forbids initialization of member 'mCapacity'
../oclJPEGDecoder-master/src/bitstream.h:369: error: making 'mCapacity' static
../oclJPEGDecoder-master/src/bitstream.h:369: error: ISO C++ forbids in-class initialization of non-const static member 'mCapacity'
../oclJPEGDecoder-master/src/bitstream.h: In member function 'void BitStream::free()':
../oclJPEGDecoder-master/src/bitstream.h:96: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h:96: error: 'nullptr' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h:98: error: type '<type error>' argument given to 'delete', expected pointer
../oclJPEGDecoder-master/src/bitstream.h: In member function 'void BitStream::trim()':
../oclJPEGDecoder-master/src/bitstream.h:110: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'bool BitStream::reserve(size_t)':
../oclJPEGDecoder-master/src/bitstream.h:137: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'bool BitStream::frontBit() const':
../oclJPEGDecoder-master/src/bitstream.h:209: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'uint8_t BitStream::frontFullByte() const':
../oclJPEGDecoder-master/src/bitstream.h:214: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'uint32_t BitStream::front9b(uint8_t) const':
../oclJPEGDecoder-master/src/bitstream.h:219: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'uint32_t BitStream::front17b(uint8_t) const':
../oclJPEGDecoder-master/src/bitstream.h:227: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'uint32_t BitStream::front25b(uint8_t) const':
../oclJPEGDecoder-master/src/bitstream.h:235: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'void BitStream::writeBit(bool)':
../oclJPEGDecoder-master/src/bitstream.h:246: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h:248: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'const uint8_t* BitStream::frontData() const':
../oclJPEGDecoder-master/src/bitstream.h:307: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'uint32_t BitStream::cachedFrontBits(int)':
../oclJPEGDecoder-master/src/bitstream.h:340: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.h: In member function 'void BitStream::moveDataTo(uint8_t*)':
../oclJPEGDecoder-master/src/bitstream.h:398: error: 'mBitReservoir' was not declared in this scope
../oclJPEGDecoder-master/src/bitstream.cpp: In member function 'size_t BitStream::append(const uint8_t*, size_t)':
../oclJPEGDecoder-master/src/bitstream.cpp:22: error: 'mBitReservoir' was not declared in this scope
make: *** [bitstream.o] Error 1
18:38:06: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project oclJPEGDecoder-master (kit: Desktop Qt 5.6.2 GCC 64bit)
When executing step "Make"
18:38:06: Elapsed time: 00:00.
I got errors in bitstream.c due to incompatibility with the compiler.
How can I get around this issue? Do I absolutely need to install a new version of g++ to get this code to work? Do I need to include anything in my Makefile?
Please guide me in this matter.
EDIT:
My output for g++ --version:
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I typed yum install rpmdevtools rpm-build and it gave me the following response:
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security,
: subscription-manager
Setting up Install Process
Package rpmdevtools-7.5-2.el6.noarch already installed and latest version
Package rpm-build-4.8.0-55.el6.x86_64 already installed and latest version
Nothing to do
I wanted to obtain more information about gcc on my system so I typed this command:
yum list available |grep gcc
It gave me this response:
compat-gcc-34.x86_64 3.4.6-19.el6 rhel-6-workstation-rpms
compat-gcc-34-c++.x86_64 3.4.6-19.el6 rhel-6-workstation-rpms
compat-gcc-34-g77.x86_64 3.4.6-19.el6 rhel-6-workstation-rpms
gcc-gnat.x86_64 4.4.7-18.el6 rhel-6-workstation-rpms
gcc-java.x86_64 4.4.7-18.el6 rhel-6-workstation-rpms
gcc-objc.x86_64 4.4.7-18.el6 rhel-6-workstation-rpms
gcc-objc++.x86_64 4.4.7-18.el6 rhel-6-workstation-rpms
Your 4.4.7 version of gcc is too old to fully enable C++11 features.
You need to upgrade the compiler to a version superior to 4.6 ( at least ) or if it's possible for you, upgrade your distro (let's say RHEL 7) which includes a more recent compiler.
The environments are Cent OS 6.7, boost-1.6.2, gcc-6.2.0
I have tried to install a software, but I got some errors.
Are theses errors come from g++ ? or boost?
I can't understand these messages.. because I have never been use g++..
Here is starting line.
[root#cms CASMcode-0.2.0]# scons install
scons: Reading SConscript files ...
rm /usr/local/include/casm
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "include/casm" as "/usr/local/include/casm"
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/version/version.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude src/casm/version/version.cc
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/clex/ConfigIOStrucScore.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude -I/usr/local/boost_1_62_0/include src/casm/clex/ConfigIOStrucScore.cc
In file included from include/casm/external/Eigen/Core:263:0,
from include/casm/external/Eigen/Dense:1,
from include/casm/CASM_global_definitions.hh:13,
from include/casm/casm_io/EigenDataStream.hh:3,
from src/casm/clex/ConfigIOStrucScore.cc:3:
Error message appear here.
In file included from include/casm/casm_io/DataFormatterTools.hh:1291:0,
from include/casm/casm_io/DataFormatter_impl.hh:3,
from include/casm/casm_io/DataFormatter.hh:757,
from include/casm/clex/ConfigIO.hh:4,
from src/casm/clex/ConfigIOStrucScore.cc:6:
include/casm/casm_io/DataFormatterTools_impl.hh: In member function 'bool CASM::DataFormatterOperator<ValueType, ArgType, DataObject>::parse_args(const string&)':
include/casm/casm_io/DataFormatterTools_impl.hh:33:33: error: invalid initialization of reference of type 'const wstring& {aka const std::__cxx11::basic_string<wchar_t>&}' from expression of type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
val = std::stod(ttag);
^
And here
In file included from include/casm/clex/PrimClex.hh:14:0,
from include/casm/clex/ConfigIOStrucScore.hh:6,
from src/casm/clex/ConfigIOStrucScore.cc:7:
include/casm/clex/ChemicalReference.hh: In member function 'void CASM::ChemicalReferencePrinter::print(const std::vector<CASM::ChemicalReferenceState>&)':
include/casm/clex/ChemicalReference.hh:366:27: error: 'round' is not a member of 'std'
if(almost_equal(std::round(num), num, 1e-14)) {
^~~
according to cppreference
The generation of the implicitly-defined copy constructor is
deprecated if T has a user-defined destructor or user-defined copy
assignment operator.
but the following code, no warning message is given using clang++ and c++
struct CAT
{
CAT(){cout<<"CAT()"<<endl;}
~CAT(){}
};
int main()
{
CAT c1, c2;
CAT c3(c1); //should print out a warning?
}
clang++-3.6 -W -Wall -Wextra -pedantic -O2 -o m main.cpp -pedantic-errors -std=c++14
Is it the expected behaviour of g++ and clang++?
clang++ has this warning:
main.cpp:6:5: warning: definition of implicit copy constructor for 'CAT' is deprecated because it has a user-declared destructor [-Wdeprecated]
~CAT(){}
^
main.cpp:12:9: note: implicit copy constructor for 'CAT' first required here
CAT c3(c1); //should print out a warning?
^
1 warning generated.
demo: http://coliru.stacked-crooked.com/a/d6b31ce2d56fac5a