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

TdConfig.cmake version: unknown #72

Closed
edvardpotter opened this issue Nov 15, 2020 · 13 comments
Closed

TdConfig.cmake version: unknown #72

edvardpotter opened this issue Nov 15, 2020 · 13 comments

Comments

@edvardpotter
Copy link

When I build phptdlib (cmake .. in phptdlib/build), I get this error:

CMake Error at CMakeLists.txt:111 (find_package):
  Could not find a configuration file for package "Td" that is compatible
  with requested version "1.6.9".

  The following configuration files were considered but not accepted:

    /usr/local/td/TdConfig.cmake, version: unknown

How can I fix it?

yaroslavche added a commit that referenced this issue Nov 15, 2020
@yaroslavche
Copy link
Owner

That's because tdlib was updated to version 1.6.10. Please update from latest commit and try again.

@edvardpotter
Copy link
Author

Thanks for the fast answer! I tried again and have the same problem:

CMake Error at CMakeLists.txt:111 (find_package):
  Could not find a configuration file for package "Td" that is compatible
  with requested version "1.6.10".

  The following configuration files were considered but not accepted:

    /usr/local/td/TdConfig.cmake, version: unknown

@yaroslavche
Copy link
Owner

Seems that submodules didn't updated. Or something wrong with installed Td. Exists few ways to install:

  • git clone --recurse-submodules
  • install shared (separately) Td and use cmake flags cmake -D USE_SHARED_TD:BOOL=ON

Which one do you use? Please describe what you do.
Also you can check this documentation section. And maybe try to fully remove and try again.

@edvardpotter
Copy link
Author

edvardpotter commented Nov 16, 2020

I tried to remove PHP-CPP and phptdlib then I repeated all steps from this instruction https://yaroslavche.github.io/phptdlib/installation.html
That's what I did:

install openssl (brew install [email protected])
add symlinks for libssl.dylib and libcrypto.dylib:

sudo ln -s /usr/local/Cellar/[email protected]/1.1.1g/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.dylib
sudo ln -s /usr/local/Cellar/[email protected]/1.1.1g/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.dylib
cd projects

git clone https://github.com/CopernicaMarketingSoftware/PHP-CPP.git
cd PHP-CPP
make
sudo make install

cd ../

git clone --recurse-submodules https://github.com/yaroslavche/phptdlib.git
cd phptdlib && mkdir build && cd build
cmake .. -DOPENSSL_ROOT_DIR="/usr/local/opt/[email protected]" -DOPENSSL_CRYPTO_LIBRARY="/usr/local/lib/libcrypto.dylib" -DOPENSSL_SSL_LIBRARY=/usr/local/lib/libssl.dylib
make

DOPENSSL_ROOT_DIR - without this param you can get this error:

-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)

DOPENSSL_CRYPTO_LIBRARY and DOPENSSL_SSL_LIBRARY - without this param you can get this error:

cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64

But I got new error:

Scanning dependencies of target tdlib
[ 98%] Building CXX object CMakeFiles/tdlib.dir/tdlib.cpp.o
/Users/vip/projects/phptdlib/tdlib.cpp:3:10: fatal error: 'phpcpp.h' file not found
#include <phpcpp.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/tdlib.dir/tdlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/tdlib.dir/all] Error 2
make: *** [all] Error 2

I also checked /usr/local/include and there is phpcpp.h

NOTE: My OS is OSX

@yaroslavche
Copy link
Owner

yaroslavche commented Nov 17, 2020

Now looks like cmake found needed dependecies and you have problem with PHP-CPP (not installed, or just can't find, and IDK why).
Try this

git clone https://github.com/CopernicaMarketingSoftware/PHP-CPP.git
cd PHP-CPP
make
sudo make install

before cmake (don't forget clean previous build if needed within just removing build dir). Also please check how to install PHP-CPP in OSX.

In few words, what you need:

  • installed PHP-CPP, which can't be installed as other (with submodules), and should be installed separately.
  • installed tdlib and json, which in your case installs as submodules (already ok).

And install.sh wont work in OSX, since doesn't support -A flag for declaring array. If someone can say what alternative is, then easier would be use that installation script with shared libs.

@edvardpotter
Copy link
Author

PHP-CPP is installed correctly but I it's OSX problem (https://bbqsoftwares.com/blog/xdebug-catalina-issue#the-catalina-issue) because there is not /usr/include/ folder.

Do you know how can I change /usr/include to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include in header files?

@yaroslavche
Copy link
Owner

Try to specify include path as arg:

cmake -DCMAKE_CXX_FLAGS="-I path/to/.../usr/include" ..

or maybe:

CXXFLAGS=-isystem\ /path/to/.../usr/include cmake ..

And I can't answer to your question, since I don't know

@yaroslavche
Copy link
Owner

yaroslavche commented Nov 20, 2020

@edvardpotter , seems I've understood your question and have an answer. It lies in error message:

/Users/vip/projects/phptdlib/tdlib.cpp:3:10: fatal error: 'phpcpp.h' file not found
#include <phpcpp.h>

You could try to #include "/path/to/your/phpcpp.h" in file /Users/vip/projects/phptdlib/tdlib.cpp on line 3.

Also you could try to add INCLUDE path for make:

$ CFLAGS="-I/path/tou/your/usr/include" make

and if need (but shouldn't), also specify LIB path:

$ LDFLAGS="-L/your/usr/lib" CFLAGS="-I/your/usr/include" make

This would better way since you don't need edit code.

@edvardpotter
Copy link
Author

Both options don't work correctly:
If I set CFLAGS, still get the same error:

build % CFLAGS="-I/usr/local/include" make
[  0%] Built target tdsqlite
[  0%] Built target generate_mime_types_gperf
[  1%] Built target tdmime_auto
[ 25%] Built target tdutils
[ 26%] Built target tdactor
[ 30%] Built target tddb
[ 33%] Built target tdtl
[ 36%] Built target generate_common
[ 36%] Generate common tl source files
[ 36%] Built target tl_generate_common
[ 36%] Built target tdapi
[ 42%] Built target tdnet
[ 92%] Built target tdcore
[ 94%] Built target tdclient
[ 95%] Built target generate_json
[ 95%] Generate JSON tl source files
[ 95%] Built target tl_generate_json
[ 97%] Built target tdjson_private
[ 97%] Built target tdjson_static
[ 98%] Building CXX object CMakeFiles/tdlib.dir/tdlib.cpp.o
/Users/vip/projects/phptdlib/tdlib.cpp:3:10: fatal error: 'phpcpp.h' file not found
#include <phpcpp.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/tdlib.dir/tdlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/tdlib.dir/all] Error 2
make: *** [all] Error 2

If I change path to phpcpp.h in tdlib.cpp

#include "/usr/local/include/phpcpp.h"

get this error:

make                               
[  0%] Built target tdsqlite
[  0%] Built target generate_mime_types_gperf
[  1%] Built target tdmime_auto
[ 25%] Built target tdutils
[ 26%] Built target tdactor
[ 30%] Built target tddb
[ 33%] Built target tdtl
[ 36%] Built target generate_common
[ 36%] Generate common tl source files
[ 36%] Built target tl_generate_common
[ 36%] Built target tdapi
[ 42%] Built target tdnet
[ 92%] Built target tdcore
[ 94%] Built target tdclient
[ 95%] Built target generate_json
[ 95%] Generate JSON tl source files
[ 95%] Built target tl_generate_json
[ 97%] Built target tdjson_private
[ 97%] Built target tdjson_static
Scanning dependencies of target tdlib
[ 98%] Building CXX object CMakeFiles/tdlib.dir/tdlib.cpp.o
In file included from /Users/vip/projects/phptdlib/tdlib.cpp:3:
/usr/local/include/phpcpp.h:30:10: error: 'phpcpp/visibility.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/visibility.h>
         ^~~~~~~~~~~~~~~~~~~~~
         "phpcpp/visibility.h"
/usr/local/include/phpcpp.h:31:10: error: 'phpcpp/deprecated.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/deprecated.h>
         ^~~~~~~~~~~~~~~~~~~~~
         "phpcpp/deprecated.h"
/usr/local/include/phpcpp.h:32:10: error: 'phpcpp/noexcept.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/noexcept.h>
         ^~~~~~~~~~~~~~~~~~~
         "phpcpp/noexcept.h"
/usr/local/include/phpcpp.h:33:10: error: 'phpcpp/thread_local.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/thread_local.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
         "phpcpp/thread_local.h"
/usr/local/include/phpcpp.h:34:10: error: 'phpcpp/platform.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/platform.h>
         ^~~~~~~~~~~~~~~~~~~
         "phpcpp/platform.h"
/usr/local/include/phpcpp.h:35:10: error: 'phpcpp/version.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/version.h>
         ^~~~~~~~~~~~~~~~~~
         "phpcpp/version.h"
/usr/local/include/phpcpp.h:36:10: error: 'phpcpp/inivalue.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/inivalue.h>
         ^~~~~~~~~~~~~~~~~~~
         "phpcpp/inivalue.h"
/usr/local/include/phpcpp.h:37:10: error: 'phpcpp/ini.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/ini.h>
         ^~~~~~~~~~~~~~
         "phpcpp/ini.h"
/usr/local/include/phpcpp.h:38:10: error: 'phpcpp/throwable.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/throwable.h>
         ^~~~~~~~~~~~~~~~~~~~
         "phpcpp/throwable.h"
/usr/local/include/phpcpp.h:39:10: error: 'phpcpp/exception.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/exception.h>
         ^~~~~~~~~~~~~~~~~~~~
         "phpcpp/exception.h"
/usr/local/include/phpcpp.h:40:10: error: 'phpcpp/error.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/error.h>
         ^~~~~~~~~~~~~~~~
         "phpcpp/error.h"
/usr/local/include/phpcpp.h:41:10: error: 'phpcpp/streams.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/streams.h>
         ^~~~~~~~~~~~~~~~~~
         "phpcpp/streams.h"
/usr/local/include/phpcpp.h:42:10: error: 'phpcpp/message.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/message.h>
         ^~~~~~~~~~~~~~~~~~
         "phpcpp/message.h"
/usr/local/include/phpcpp.h:43:10: error: 'phpcpp/type.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/type.h>
         ^~~~~~~~~~~~~~~
         "phpcpp/type.h"
/usr/local/include/phpcpp.h:44:10: error: 'phpcpp/hashparent.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/hashparent.h>
         ^~~~~~~~~~~~~~~~~~~~~
         "phpcpp/hashparent.h"
/usr/local/include/phpcpp.h:45:10: error: 'phpcpp/value.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/value.h>
         ^~~~~~~~~~~~~~~~
         "phpcpp/value.h"
/usr/local/include/phpcpp.h:46:10: error: 'phpcpp/valueiterator.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/valueiterator.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
         "phpcpp/valueiterator.h"
/usr/local/include/phpcpp.h:47:10: error: 'phpcpp/array.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/array.h>
         ^~~~~~~~~~~~~~~~
         "phpcpp/array.h"
/usr/local/include/phpcpp.h:48:10: error: 'phpcpp/object.h' file not found with <angled> include; use "quotes" instead
#include <phpcpp/object.h>
         ^~~~~~~~~~~~~~~~~
         "phpcpp/object.h"
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/tdlib.dir/tdlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/tdlib.dir/all] Error 2
make: *** [all] Error 2

@yaroslavche
Copy link
Owner

build % CFLAGS="-I/usr/local/include" make

You should specify dir, where phpcpp.h is. So try this:

CFLAGS="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" make

If this wont help, then I just don't know how to help and just can advise to use docker (or maybe linux) or try to find how to include needed file for make (or through cmake) in OSX.

@edvardpotter
Copy link
Author

edvardpotter commented Nov 20, 2020

My phpcpp.h exists in /usr/local/include

cat /usr/local/include/phpcpp.h                                             
/**
 *  phpcpp.h
 *
 *  Library to build PHP extensions with CPP
 *
 *  @copyright 2013 - 2019 Copernica BV
 *  @author Emiel Bruijntjes <[email protected]>
 */

#ifndef PHPCPP_H
#define PHPCPP_H

/**
 *  Other C and C++ libraries that PhpCpp depends on
 */
#include <string.h>
#include <string>
#include <initializer_list>
#include <vector>
#include <memory>
#include <list>
#include <exception>
#include <map>
#include <set>
#include <functional>

/**
 *  Include all headers files that are related to this library
 */
#include <phpcpp/visibility.h>
#include <phpcpp/deprecated.h>
#include <phpcpp/noexcept.h>
#include <phpcpp/thread_local.h>
#include <phpcpp/platform.h>
#include <phpcpp/version.h>
#include <phpcpp/inivalue.h>
#include <phpcpp/ini.h>
#include <phpcpp/throwable.h>
#include <phpcpp/exception.h>
#include <phpcpp/error.h>
#include <phpcpp/streams.h>
#include <phpcpp/message.h>
#include <phpcpp/type.h>
#include <phpcpp/hashparent.h>
#include <phpcpp/value.h>
#include <phpcpp/valueiterator.h>
#include <phpcpp/array.h>
#include <phpcpp/object.h>
#include <phpcpp/globals.h>
#include <phpcpp/argument.h>
#include <phpcpp/byval.h>
#include <phpcpp/byref.h>
#include <phpcpp/global.h>
#include <phpcpp/hashmember.h>
#include <phpcpp/super.h>
#include <phpcpp/parameters.h>
#include <phpcpp/modifiers.h>
#include <phpcpp/base.h>
#include <phpcpp/countable.h>
#include <phpcpp/arrayaccess.h>
#include <phpcpp/iterator.h>
#include <phpcpp/traversable.h>
#include <phpcpp/serializable.h>
#include <phpcpp/classtype.h>
#include <phpcpp/classbase.h>
#include <phpcpp/constant.h>
#include <phpcpp/interface.h>
#include <phpcpp/zendcallable.h>
#include <phpcpp/class.h>
#include <phpcpp/namespace.h>
#include <phpcpp/extension.h>
#include <phpcpp/call.h>
#include <phpcpp/script.h>
#include <phpcpp/file.h>
#include <phpcpp/function.h>
#include <phpcpp/stream.h>

#endif /* phpcpp.h */

@yaroslavche
Copy link
Owner

Sorry then, IDK why make on OSX wont include files from default user local include dir. If you would find a solution, then please just let me know. I'm sure that it could help to other OSX users

@edvardpotter
Copy link
Author

Okay, thank you for your help)

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

2 participants