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 on ubuntu 16.10 #523

Closed
yosoufe opened this issue Dec 4, 2016 · 12 comments
Closed

compiling on ubuntu 16.10 #523

yosoufe opened this issue Dec 4, 2016 · 12 comments

Comments

@yosoufe
Copy link

yosoufe commented Dec 4, 2016

Hi
I have recently installed ubuntu 16.10 and I am trying to install stlink driver. Unfortunately I cannot compile the code. What am I doing wrong? problems with ubuntu 16.10?

CMakeFiles_output.zip

This is the output of the make release command:

make release

-- The C compiler identification is GNU 6.2.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at cmake/Version.cmake:25 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:15 (include)

-- Performing Test C_SUPPORTS_STD_GNU99
-- Performing Test C_SUPPORTS_STD_GNU99 - Success
-- Performing Test C_SUPPORTS_WALL
-- Performing Test C_SUPPORTS_WALL - Success
-- Performing Test C_SUPPORTS_WEXTRA
-- Performing Test C_SUPPORTS_WEXTRA - Success
-- Performing Test C_SUPPORTS_WSHADOW
-- Performing Test C_SUPPORTS_WSHADOW - Success
-- Performing Test C_SUPPORTS_D_FORTIFY_SOURCE_2
-- Performing Test C_SUPPORTS_D_FORTIFY_SOURCE_2 - Success
-- Performing Test C_SUPPORTS_FSTRICT_ALIASING
-- Performing Test C_SUPPORTS_FSTRICT_ALIASING - Success
-- Performing Test C_SUPPORTS_WUNDEF
-- Performing Test C_SUPPORTS_WUNDEF - Success
-- Performing Test C_SUPPORTS_WFORMAT
-- Performing Test C_SUPPORTS_WFORMAT - Success
-- Performing Test C_SUPPORTS_WFORMAT_SECURITY
-- Performing Test C_SUPPORTS_WFORMAT_SECURITY - Success
-- Performing Test C_SUPPORTS_WMAYBE_UNINITIALIZED
-- Performing Test C_SUPPORTS_WMAYBE_UNINITIALIZED - Success
-- Performing Test C_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS
-- Performing Test C_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS - Failed
-- Performing Test C_SUPPORTS_WSHORTEN_64_TO_32
-- Performing Test C_SUPPORTS_WSHORTEN_64_TO_32 - Failed
-- Performing Test C_SUPPORTS_WIMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WIMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test C_SUPPORTS_WREDUNDANT_DECLS
-- Performing Test C_SUPPORTS_WREDUNDANT_DECLS - Success
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Found Libusb: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'gtk+-3.0'
-- Found gtk+-3.0, version 3.20.9
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Manpage generation disabled
-- Configuring incomplete, errors occurred!
See also ".../Toolchain/stlink/build/Release/CMakeFiles/CMakeOutput.log".
See also ".../Toolchain/stlink/build/Release/CMakeFiles/CMakeError.log".
Makefile:42: recipe for target 'build/Release' failed
make: *** [build/Release] Error 1

And this is the CMakeError.log:

Performing C SOURCE FILE Test C_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS failed with the following output:
Change Dir: .../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f6585/fast"
make[1]: Entering directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_f6585.dir/build.make CMakeFiles/cmTC_f6585.dir/build
make[2]: Entering directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f6585.dir/src.c.o
/usr/bin/cc -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations -o CMakeFiles/cmTC_f6585.dir/src.c.o -c .../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command line option '-Wmissing-variable-declarations'; did you mean '-Wmissing-declarations'?
CMakeFiles/cmTC_f6585.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_f6585.dir/src.c.o' failed
make[2]: *** [CMakeFiles/cmTC_f6585.dir/src.c.o] Error 1
make[2]: Leaving directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_f6585/fast' failed
make[1]: *** [cmTC_f6585/fast] Error 2
make[1]: Leaving directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'

Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test C_SUPPORTS_WSHORTEN_64_TO_32 failed with the following output:
Change Dir: .../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_04dd3/fast"
make[1]: Entering directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_04dd3.dir/build.make CMakeFiles/cmTC_04dd3.dir/build
make[2]: Entering directory '...Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_04dd3.dir/src.c.o
/usr/bin/cc -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WSHORTEN_64_TO_32 -Wshorten-64-to-32 -o CMakeFiles/cmTC_04dd3.dir/src.c.o -c .../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command line option '-Wshorten-64-to-32'
CMakeFiles/cmTC_04dd3.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_04dd3.dir/src.c.o' failed
make[2]: *** [CMakeFiles/cmTC_04dd3.dir/src.c.o] Error 1
make[2]: Leaving directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_04dd3/fast' failed
make[1]: *** [cmTC_04dd3/fast] Error 2
make[1]: Leaving directory '.../Toolchain/stlink/build/Release/CMakeFiles/CMakeTmp'

Source file was:
int main(void) { return 0; }

@xor-gate
Copy link
Member

xor-gate commented Dec 4, 2016

It seems (your) cmake (version) chokes on this: https://github.com/texane/stlink/blob/master/cmake/Version.cmake#L25-L26

Which version are you running cmake --version?
If I look at the ubuntu package list you should be running 3.5.x (http://packages.ubuntu.com/yakkety/cmake)

@yosoufe yosoufe changed the title compilation on ubuntu 16.10 compiling on ubuntu 16.10 Dec 4, 2016
@yosoufe
Copy link
Author

yosoufe commented Dec 4, 2016

Thanks for response.

it is cmake version 3.5.2
How can I solve it? I am newbie in these topics

@xor-gate
Copy link
Member

xor-gate commented Dec 5, 2016

I need to investigate this. As I have no problems with cmake 3.0 (debian 8) and 3.7 (mac osx). Did you do a git clone or downloaded a zip file with sources?

@xor-gate xor-gate self-assigned this Dec 5, 2016
@xor-gate xor-gate added this to the v1.3.0 milestone Dec 5, 2016
@yosoufe
Copy link
Author

yosoufe commented Dec 5, 2016

I downloaded the zip file

@xor-gate
Copy link
Member

xor-gate commented Dec 5, 2016

I have proposed a fix. It was due to developing and building from a git tree (and version detection from git), and I have not checked against zipfile source building.

Thanks for reporting, it should work now!

@xor-gate
Copy link
Member

xor-gate commented Dec 5, 2016

I need to fix this (also) on older git versions, reopening... It seems the continues integration build has failed.

Manual tested on

  • Debian 8, cmake 3.0, git version ??
  • Mac OS X, cmake 3.7, git version 2.9.3 (Apple Git-75)

Broken on

  • Ubuntu ?version 12? on Travis CI (needs exact versions reported >here<)

@xor-gate xor-gate reopened this Dec 5, 2016
@newtoniant
Copy link

I too am getting this build error on Ubuntu 16.04 LTS, cmake version 3.5.1

Errors in the log:
unrecognized command line option '-Wmissing-variable-declarations'
unrecognized command line option '-Wshorten-64-to-32'

@xor-gate
Copy link
Member

xor-gate commented Jan 25, 2017

@newtoniant this should not be relevant when using a newer zipfile (master.zip). Commit 0c63a2c should fix this.

@xor-gate
Copy link
Member

Closing, preparing for v1.3.0. Feel free to open a new issue after the new release has happend.

@alukichev
Copy link

This appears also when building from git tree with git checkout 1.3.1; make debug on Fedora 25 (gcc 6.3.1, cmake 3.6.2). CMakeOutput.log and CMakeError.log are attached.

In particular, errors are the same:

Performing C SOURCE FILE Test C_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS failed with the following output:
...
/usr/lib64/ccache/cc -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WMISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations -o CMakeFiles/cmTC_df367.dir/src.c.o -c /home/blablabla/stlink/build/Release/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command line option '-Wmissing-variable-declarations'; did you mean '-Wmissing-declarations'?

...

Performing C SOURCE FILE Test C_SUPPORTS_WSHORTEN_64_TO_32 failed with the following output:
...
/usr/lib64/ccache/cc -std=gnu99 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmaybe-uninitialized -DC_SUPPORTS_WSHORTEN_64_TO_32 -Wshorten-64-to-32 -o CMakeFiles/cmTC_0ceee.dir/src.c.o -c /home/blablabla/stlink/build/Release/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command line option '-Wshorten-64-to-32'

Requesting to reopen the issue.

@alukichev
Copy link

Problem solved. I was missing libusb headers : - ) . Sorry to bother.

@fedorg
Copy link

fedorg commented May 5, 2018

The easiest solution is to remove the .git directory and try again:
rm -r build && sudo rm -rf .git && make
It works on Linux Mint 18.3 and probably everywhere.
Oh, and don't forget to run sudo ldconfig after sudo make install

@stlink-org stlink-org deleted a comment from michelepagot Mar 18, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants