DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 20th January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default CMake problem

Code:
$cmake ../sdcv-0.5.0-beta2-Source
$ ls
CMakeCache.txt  CPackConfig.cmake        Makefile             config.h
CMakeFiles      CPackSourceConfig.cmake  cmake_install.cmake  

$make
[ 12%] Building CXX object CMakeFiles/sdcv.dir/src/sdcv.cpp.o
cc1plus: error: unrecognized command line option "-std=c++11"
*** Error 1 in . (CMakeFiles/sdcv.dir/build.make:59 'CMakeFiles/sdcv.dir/src/sdcv.cpp.o': /usr/bin/c++   -DHAVE_CONFIG_H -DVERSION=\"0.5.0-b...)
*** Error 1 in . (CMakeFiles/Makefile2:95 'CMakeFiles/sdcv.dir/all')
*** Error 1 in /home/sw2wolf/test/tmp (Makefile:137 'all')
Sincerely!
Reply With Quote
  #2   (View Single Post)  
Old 20th January 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,180
Default

The first error message indicates you are not using the correct compiler.
Quote:
cc1plus: error: unrecognized command line option "-std=c++11"
From memory, I recall that the port/package lang/g++ is c++11 compliant at 4.8 or above.

This description happens to be from -current:
Code:
$ pkg_info g++
Information for http://mirrors.gigenet.com/pub/OpenBSD/snapshots/packages/i386/g++-4.8.4.tgz

Comment:
GNU compiler collection: C++ compiler

Description:
The GNU Compiler Collection (GCC) includes front ends for C, C++,
Objective-C, Fortran, Java, and Ada, as well as libraries for these
languages (libstdc++, libgcj,...).

GCC development is a part of the GNU Project and uses an open
development environment. Its supports many other platforms in order to
foster a world-class optimizing compiler, to attract a larger team of
developers, to ensure that GCC and the GNU system work on multiple
architectures and diverse environments, and to more thoroughly test and
extend the features of GCC.

This package contains the C++ compiler.

Maintainer: Pascal Stumpf <redacted>

WWW: http://gcc.gnu.org/


Information for http://mirrors.gigenet.com/pub/OpenBSD/snapshots/packages/i386/g++-4.9.2p0.tgz

Comment:
GNU compiler collection: C++ compiler

Description:
The GNU Compiler Collection (GCC) includes front ends for C, C++,
Objective-C, Fortran, Java, and Ada, as well as libraries for these
languages (libstdc++, libgcj,...).

GCC development is a part of the GNU Project and uses an open
development environment. Its supports many other platforms in order to
foster a world-class optimizing compiler, to attract a larger team of
developers, to ensure that GCC and the GNU system work on multiple
architectures and diverse environments, and to more thoroughly test and
extend the features of GCC.

This package contains the C++ compiler.

Maintainer: Pascal Stumpf <redacted>

WWW: http://gcc.gnu.org/

$ pkg_info -L g++
Information for http://mirrors.gigenet.com/pub/OpenBSD/snapshots/packages/i386/g++-4.8.4.tgz

Files:
/usr/local/bin/ec++
/usr/local/bin/eg++
/usr/local/bin/i386-unknown-openbsd5.7-ec++
/usr/local/bin/i386-unknown-openbsd5.7-eg++
/usr/local/include/c++/4.8.4/algorithm
/usr/local/include/c++/4.8.4/array
/usr/local/include/c++/4.8.4/atomic
.
.
.

Last edited by jggimi; 20th January 2015 at 06:09 PM. Reason: redacted $MAINTAINER Email
Reply With Quote
  #3   (View Single Post)  
Old 20th January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default

jggimi, thanks!
Code:
$pkg_info g++
Information for inst:g++-4.9.0p0
Comment:
GNU compiler collection: C++ compiler
...
CMake still cannot work!

Last edited by sw2wolf; 21st January 2015 at 12:36 AM.
Reply With Quote
  #4   (View Single Post)  
Old 20th January 2015
ibara's Avatar
ibara ibara is offline
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 542
Default

If you're just compiling stuff on your own, you can do this:
Code:
$ CC=egcc CXX=eg++ cmake ..
However, if you have devel/ninja installed it makes builds faster:
Code:
$ CC=egcc CXX=eg++ cmake -G Ninja ..
then run
Code:
$ ninja -v
Another way to set compilers in CMake:
Code:
$ cmake -G Ninja -DCMAKE_C_COMPILER=egcc -DCMAKE_CXX_COMPILER=eg++ ..
Reply With Quote
  #5   (View Single Post)  
Old 21st January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default

hi, ibara
Code:
~/test/tmp $ CC=egcc CXX=eg++ cmake ../sdcv-0.5.0-beta2-Source/
-- REQUIRED_VARS
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sw2wolf/test/tmp

~/test/tmp $ make
[ 12%] Building CXX object CMakeFiles/sdcv.dir/src/sdcv.cpp.o
cc1plus: error: unrecognized command line option "-std=c++11"
*** Error 1 in . (CMakeFiles/sdcv.dir/build.make:59 'CMakeFiles/sdcv.dir/src/sdcv.cpp.o': /usr/bin/c++   -DHAVE_CONFIG_H -DVERSION=\"0.5.0-b...)
*** Error 1 in . (CMakeFiles/Makefile2:95 'CMakeFiles/sdcv.dir/all')
*** Error 1 in /home/sw2wolf/test/tmp (Makefile:137 'all')
weird CMake ! Why does the author of sdcv use CMake ?
Reply With Quote
  #6   (View Single Post)  
Old 21st January 2015
ibara's Avatar
ibara ibara is offline
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 542
Default

It's still trying to use the in-base c++ (note the /usr/bin/c++ in your output). (Did you install g++-4.8?)
What are you trying to compile? If I can look at it I can probably get a better feel for it.
Reply With Quote
  #7   (View Single Post)  
Old 21st January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default

Quote:
Originally Posted by ibara View Post
It's still trying to use the in-base c++ (note the /usr/bin/c++ in your output). (Did you install g++-4.8?)
What are you trying to compile? If I can look at it I can probably get a better feel for it.
The sdcv is a dictionary software.

Regards!
Attached Files
File Type: bz2 sdcv-0.5.0-beta2-Source.tar.bz2 (50.3 KB, 13 views)
Reply With Quote
  #8   (View Single Post)  
Old 21st January 2015
ibara's Avatar
ibara ibara is offline
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 542
Default

Yup it looks like you didn't install g++-4.8
Code:
# pkg_add g++
Choose 4.8.4 (or whichever 4.8 you get).

I found this to work:
Code:
$ tar xvjf sdcv-0.5.0-beta2-Source.tar.bz2
$ cd sdcv-0.5.0-beta2-Source
$ mkdir -p build
$ cd build
$ CXX=eg++ CXXFLAGS='-O2 -pipe -pthread' LDFLAGS=-lncurses cmake -G Ninja ..
$ ninja -v
A binary sdcv should be waiting for you in the build/ directory.

Last edited by ibara; 21st January 2015 at 06:26 AM. Reason: Typos are cool. All the cool kids are doing it.
Reply With Quote
  #9   (View Single Post)  
Old 21st January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default

It works like a charm, thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot problem. Geometry problem? gulanito FreeBSD Installation and Upgrading 0 3rd July 2009 03:03 AM


All times are GMT. The time now is 03:14 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick