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
cmake encounter error on mac #360
Comments
@luckypoem can you dump |
Try out
|
Tested on OSX+brew, after uninstalling and reinstalling OpenSSL I got the same type of error:
After the above commands:
So that works. Mind if I close? |
what commands are your " the above commands"? |
there are no commands in the #360 ... only messages. what commands did you use to make it work? |
OK, again:
|
That command doesn't seem to work...
|
Oh, 2.0. You can try out the OPENSSL_LIBADD env flag. |
@luckypoem / @lifejuggler any progress? |
adding the flag worked for me. I dunno about luckypoem |
The following worked for me with 2.0.21-stable on El Capitan 10.11.6 : |
Okay, I guess this can be closed. |
Hi guys, I am quite new to this lib, can you give me more detail how to fix it by adding flag? thanks, |
I did follow @kerneljake , but i got errors below:
|
@nquoctuan do you use AFAIR there are some changes with locations oh libs/headers (on 10.12 or so) so can you try something like this instead P.S. totally untested. |
Hi @azat , Yes, i try to build libevent for compiling thrift on macos. Below is the result of
Any ideas? |
You can try next: autotools
export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
./configure
./make
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig ./configure && make cmake
And for now autotools is preferable build system. |
Thanks @azat , i will try it now. |
@nquoctuan can you fix it |
I find the above solutions don't work for macos 10.13.3 now! cmake -DCMAKE_TOOLCHAIN_FILE=./ios.cmake -DIOS_PLATFORM=OS -H. -BXcode -GXcode |
@Shunzi007 are you sure that openssl installed at |
@azat Yes, I am sure. if I run However, in my project, in which libevent is a subdirectory, I run cmake command
so I wonder whether could I add some line into the CMakeList.txt. |
@Shunzi007 I don't think that the problem is in libevent's cmake rules, could you post output of (upd: better upload it to some pastebin and post the link here) |
do
the last suggestion goes wrong now?
|
I'm not sure that I understand you @Shunzi007 Could you post the full (by full I mean run of
Without this I cannot help you, since I don't know any details. |
@azat |
Just like I though, looks like Post the output of BTW if you installed openssl correctly then you don't have to set |
|
I see references to "ios", is this for iPhone / iPad? Which are ARMv8 architecture? The x86_64 openssl built by homebrew won't work for that. |
Looks like. |
@ploxiln Yes, it is an iOS app. I want to start a server in it. so I need to build a arm64 openssl for it? I will have a try. |
Yeah, but this will explains why it will not link with them, but not the fact that it cannot find it, it cannot detect even the version from the header, even though it exists. Obviously, I'm missing something here.. |
And the reason this is /Users/wangshun/Code/ios-cmake/ios.cmake(137): set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE string iOS find search path root ) Since |
@azat Yes, I think the main problem is cmake can not find openssl. I have tried with (https://github.com/x2on/OpenSSL-for-iPhone) to get openssl for iOS, and then use |
Hi guys, I have found a way to fix the cmake issue, I just add library and include path and the command now is |
This is an option, but not a good thing to do, you should base your openssl location against your Please read the cross compiling doc from #360 (comment) And to turn off openssl you could add |
@azat Hi, the project still has build errors, I need your help.
Here is the result (https://gist.github.com/Shunzi007/423ec8d0604cb35f1d0263613e20fca6) Could you have a try and help me fix these? |
I guess it just cannot find path to headers, that created by cmake, particularly:
And I don't know how xcode doing this, so you have to figure this out by yourself. |
hi.
git clone https://github.com/libevent/libevent
cd libevent
mkdir build
cd build
cmake ..
it exports:
...
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
...
but actually previously i already installed openssl on mac successfully:
$ git clone https://github.com/openssl/openssl
$ cd openssl
yudeMacBook-Air:openssl brite$ export CPPFLAGS=-I/usr/local/cellar/openssl/include
yudeMacBook-Air:openssl brite$ export LDFLAGS=-L/usr/local/cellar/openssl/lib
yudeMacBook-Air:openssl brite$ ./config --prefix=/usr/local/cellar/openssl/
yudeMacBook-Air:openssl brite$ make
yudeMacBook-Air:openssl brite$ make install
so,how to fix the issue?
The text was updated successfully, but these errors were encountered: