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

CMake-based Xcode build fails to build any library #355

Closed
HeinrichJanzing opened this issue Jan 4, 2017 · 9 comments
Closed

CMake-based Xcode build fails to build any library #355

HeinrichJanzing opened this issue Jan 4, 2017 · 9 comments

Comments

@HeinrichJanzing
Copy link

I'm using CMake 3.6.1 and Xcode 8. I'm attempting to build cryptopp 5.6.5.

When attempting to build the static or shared library using cmake with the Xcode generator, the library itself is never created. The shared target fails due to the missing output file at some point while the static target claims to succeed despite the same lack of output.

It appears to be caused by (at least for CMake >= 2.8.8) the shared and static library targets having only object files as input. According to the documentation for cmake's add_library:

Some native build systems may not like targets that have only object files, so consider adding at least one real source file to any target that references $<TARGET_OBJECTS:objlib>.

It would seem this is the case for Xcode. I see several options:

  1. You tell me you don't care about Xcode (or any other affected generators), in which case I'll maintain a patch locally.
  2. Applying the workaround suggested in the documentation. This could be done by creating an empty source file in the build directory and adding it to the target. A small and fairly local fix but hacky and perhaps even fragile.
  3. The use of an intermediate objects target is made optional (rather than defined purely by the CMake version used) so it can be disabled manually in case of issues. This is my personal favorite. I would attach a patch for it but I'm having too much fun with the line endings. I'll try again tomorrow.
HeinrichJanzing added a commit to HeinrichJanzing/cryptopp that referenced this issue Jan 5, 2017
…ct).

Targets with only object inputs do not work correctly with some
generators (like Xcode, see issue weidai11#355). Defining these directly in
terms of the source code files (rather than a reused set of object
files) allows correct builds in such cases. This can now be controlled
through a new option USE_INTERMEDIATE_OBJECTS_TARGET which defaults to
ON.
@noloader
Copy link
Collaborator

noloader commented Jan 8, 2017

Now open on the user list: Issue 335: CMake-based Xcode build fails to build any library

@mouse07410
Copy link
Collaborator

mouse07410 commented Jan 8, 2017

I don't think this report is correct. Here you can see a cmake build of the current Github master on MacOS Sierra, Xcode-8.2.1, Macports-installed cmake-3.7.1 (though it worked on previous versions of Mac OS X, older Xcode, and older cmake):

$ mkdir build
$ cd build
$ cmake ..
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /opt/local/bin/clang
-- Check for working C compiler: /opt/local/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/local/bin/clang++
-- Check for working CXX compiler: /opt/local/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Compiler: 
-- Flags: -maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4.2 -mtune=native -Os -Ofast -std=c++11 -march=native
-- Build type: 
-- 
-- The following OPTIONAL packages have been found:

 * Threads

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/uri/src/cryptopp/build
$ make all && make test
Scanning dependencies of target cryptopp-object
[  0%] Building CXX object CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o
[  1%] Building CXX object CMakeFiles/cryptopp-object.dir/cpu.cpp.o
[  2%] Building CXX object CMakeFiles/cryptopp-object.dir/integer.cpp.o
[  2%] Building CXX object CMakeFiles/cryptopp-object.dir/3way.cpp.o
[  3%] Building CXX object CMakeFiles/cryptopp-object.dir/adler32.cpp.o
[  4%] Building CXX object CMakeFiles/cryptopp-object.dir/algebra.cpp.o
[  5%] Building CXX object CMakeFiles/cryptopp-object.dir/algparam.cpp.o
[  5%] Building CXX object CMakeFiles/cryptopp-object.dir/arc4.cpp.o
[  6%] Building CXX object CMakeFiles/cryptopp-object.dir/asn.cpp.o
[  7%] Building CXX object CMakeFiles/cryptopp-object.dir/authenc.cpp.o
[  7%] Building CXX object CMakeFiles/cryptopp-object.dir/base32.cpp.o
[  8%] Building CXX object CMakeFiles/cryptopp-object.dir/base64.cpp.o
[  9%] Building CXX object CMakeFiles/cryptopp-object.dir/basecode.cpp.o
[ 10%] Building CXX object CMakeFiles/cryptopp-object.dir/bfinit.cpp.o
[ 10%] Building CXX object CMakeFiles/cryptopp-object.dir/blake2.cpp.o
[ 11%] Building CXX object CMakeFiles/cryptopp-object.dir/blowfish.cpp.o
[ 12%] Building CXX object CMakeFiles/cryptopp-object.dir/blumshub.cpp.o
[ 13%] Building CXX object CMakeFiles/cryptopp-object.dir/camellia.cpp.o
[ 13%] Building CXX object CMakeFiles/cryptopp-object.dir/cast.cpp.o
[ 14%] Building CXX object CMakeFiles/cryptopp-object.dir/casts.cpp.o
[ 15%] Building CXX object CMakeFiles/cryptopp-object.dir/cbcmac.cpp.o
[ 15%] Building CXX object CMakeFiles/cryptopp-object.dir/ccm.cpp.o
[ 16%] Building CXX object CMakeFiles/cryptopp-object.dir/chacha.cpp.o
[ 17%] Building CXX object CMakeFiles/cryptopp-object.dir/channels.cpp.o
[ 18%] Building CXX object CMakeFiles/cryptopp-object.dir/cmac.cpp.o
[ 18%] Building CXX object CMakeFiles/cryptopp-object.dir/crc.cpp.o
[ 19%] Building CXX object CMakeFiles/cryptopp-object.dir/default.cpp.o
[ 20%] Building CXX object CMakeFiles/cryptopp-object.dir/des.cpp.o
[ 20%] Building CXX object CMakeFiles/cryptopp-object.dir/dessp.cpp.o
[ 21%] Building CXX object CMakeFiles/cryptopp-object.dir/dh.cpp.o
[ 22%] Building CXX object CMakeFiles/cryptopp-object.dir/dh2.cpp.o
[ 23%] Building CXX object CMakeFiles/cryptopp-object.dir/dll.cpp.o
[ 23%] Building CXX object CMakeFiles/cryptopp-object.dir/dsa.cpp.o
[ 24%] Building CXX object CMakeFiles/cryptopp-object.dir/eax.cpp.o
[ 25%] Building CXX object CMakeFiles/cryptopp-object.dir/ec2n.cpp.o
[ 25%] Building CXX object CMakeFiles/cryptopp-object.dir/eccrypto.cpp.o
[ 26%] Building CXX object CMakeFiles/cryptopp-object.dir/ecp.cpp.o
[ 27%] Building CXX object CMakeFiles/cryptopp-object.dir/elgamal.cpp.o
[ 28%] Building CXX object CMakeFiles/cryptopp-object.dir/emsa2.cpp.o
[ 28%] Building CXX object CMakeFiles/cryptopp-object.dir/eprecomp.cpp.o
[ 29%] Building CXX object CMakeFiles/cryptopp-object.dir/esign.cpp.o
[ 30%] Building CXX object CMakeFiles/cryptopp-object.dir/files.cpp.o
[ 31%] Building CXX object CMakeFiles/cryptopp-object.dir/filters.cpp.o
[ 31%] Building CXX object CMakeFiles/cryptopp-object.dir/fips140.cpp.o
[ 32%] Building CXX object CMakeFiles/cryptopp-object.dir/gcm.cpp.o
[ 33%] Building CXX object CMakeFiles/cryptopp-object.dir/gf256.cpp.o
[ 33%] Building CXX object CMakeFiles/cryptopp-object.dir/gf2_32.cpp.o
[ 34%] Building CXX object CMakeFiles/cryptopp-object.dir/gf2n.cpp.o
[ 35%] Building CXX object CMakeFiles/cryptopp-object.dir/gfpcrypt.cpp.o
[ 36%] Building CXX object CMakeFiles/cryptopp-object.dir/gost.cpp.o
[ 36%] Building CXX object CMakeFiles/cryptopp-object.dir/gzip.cpp.o
[ 37%] Building CXX object CMakeFiles/cryptopp-object.dir/hex.cpp.o
[ 38%] Building CXX object CMakeFiles/cryptopp-object.dir/hmac.cpp.o
[ 38%] Building CXX object CMakeFiles/cryptopp-object.dir/hrtimer.cpp.o
[ 39%] Building CXX object CMakeFiles/cryptopp-object.dir/ida.cpp.o
[ 40%] Building CXX object CMakeFiles/cryptopp-object.dir/idea.cpp.o
[ 41%] Building CXX object CMakeFiles/cryptopp-object.dir/iterhash.cpp.o
[ 41%] Building CXX object CMakeFiles/cryptopp-object.dir/keccak.cpp.o
[ 42%] Building CXX object CMakeFiles/cryptopp-object.dir/luc.cpp.o
[ 43%] Building CXX object CMakeFiles/cryptopp-object.dir/mars.cpp.o
[ 43%] Building CXX object CMakeFiles/cryptopp-object.dir/marss.cpp.o
[ 44%] Building CXX object CMakeFiles/cryptopp-object.dir/md2.cpp.o
[ 45%] Building CXX object CMakeFiles/cryptopp-object.dir/md4.cpp.o
[ 46%] Building CXX object CMakeFiles/cryptopp-object.dir/md5.cpp.o
[ 46%] Building CXX object CMakeFiles/cryptopp-object.dir/misc.cpp.o
[ 47%] Building CXX object CMakeFiles/cryptopp-object.dir/modes.cpp.o
[ 48%] Building CXX object CMakeFiles/cryptopp-object.dir/mqueue.cpp.o
[ 48%] Building CXX object CMakeFiles/cryptopp-object.dir/mqv.cpp.o
[ 49%] Building CXX object CMakeFiles/cryptopp-object.dir/nbtheory.cpp.o
[ 50%] Building CXX object CMakeFiles/cryptopp-object.dir/network.cpp.o
[ 51%] Building CXX object CMakeFiles/cryptopp-object.dir/oaep.cpp.o
[ 51%] Building CXX object CMakeFiles/cryptopp-object.dir/osrng.cpp.o
[ 52%] Building CXX object CMakeFiles/cryptopp-object.dir/panama.cpp.o
[ 53%] Building CXX object CMakeFiles/cryptopp-object.dir/pkcspad.cpp.o
[ 54%] Building CXX object CMakeFiles/cryptopp-object.dir/poly1305.cpp.o
[ 54%] Building CXX object CMakeFiles/cryptopp-object.dir/polynomi.cpp.o
[ 55%] Building CXX object CMakeFiles/cryptopp-object.dir/pssr.cpp.o
[ 56%] Building CXX object CMakeFiles/cryptopp-object.dir/pubkey.cpp.o
[ 56%] Building CXX object CMakeFiles/cryptopp-object.dir/queue.cpp.o
[ 57%] Building CXX object CMakeFiles/cryptopp-object.dir/rabin.cpp.o
[ 58%] Building CXX object CMakeFiles/cryptopp-object.dir/randpool.cpp.o
[ 59%] Building CXX object CMakeFiles/cryptopp-object.dir/rc2.cpp.o
[ 59%] Building CXX object CMakeFiles/cryptopp-object.dir/rc5.cpp.o
[ 60%] Building CXX object CMakeFiles/cryptopp-object.dir/rc6.cpp.o
[ 61%] Building CXX object CMakeFiles/cryptopp-object.dir/rdrand.cpp.o
[ 61%] Building CXX object CMakeFiles/cryptopp-object.dir/rdtables.cpp.o
[ 62%] Building CXX object CMakeFiles/cryptopp-object.dir/rijndael.cpp.o
[ 63%] Building CXX object CMakeFiles/cryptopp-object.dir/ripemd.cpp.o
[ 64%] Building CXX object CMakeFiles/cryptopp-object.dir/rng.cpp.o
[ 64%] Building CXX object CMakeFiles/cryptopp-object.dir/rsa.cpp.o
[ 65%] Building CXX object CMakeFiles/cryptopp-object.dir/rw.cpp.o
[ 66%] Building CXX object CMakeFiles/cryptopp-object.dir/safer.cpp.o
[ 66%] Building CXX object CMakeFiles/cryptopp-object.dir/salsa.cpp.o
[ 67%] Building CXX object CMakeFiles/cryptopp-object.dir/seal.cpp.o
[ 68%] Building CXX object CMakeFiles/cryptopp-object.dir/seed.cpp.o
[ 69%] Building CXX object CMakeFiles/cryptopp-object.dir/serpent.cpp.o
[ 69%] Building CXX object CMakeFiles/cryptopp-object.dir/sha.cpp.o
[ 70%] Building CXX object CMakeFiles/cryptopp-object.dir/sha3.cpp.o
[ 71%] Building CXX object CMakeFiles/cryptopp-object.dir/shacal2.cpp.o
[ 72%] Building CXX object CMakeFiles/cryptopp-object.dir/shark.cpp.o
[ 72%] Building CXX object CMakeFiles/cryptopp-object.dir/sharkbox.cpp.o
[ 73%] Building CXX object CMakeFiles/cryptopp-object.dir/skipjack.cpp.o
[ 74%] Building CXX object CMakeFiles/cryptopp-object.dir/socketft.cpp.o
[ 74%] Building CXX object CMakeFiles/cryptopp-object.dir/sosemanuk.cpp.o
[ 75%] Building CXX object CMakeFiles/cryptopp-object.dir/square.cpp.o
[ 76%] Building CXX object CMakeFiles/cryptopp-object.dir/squaretb.cpp.o
[ 77%] Building CXX object CMakeFiles/cryptopp-object.dir/strciphr.cpp.o
[ 77%] Building CXX object CMakeFiles/cryptopp-object.dir/tea.cpp.o
[ 78%] Building CXX object CMakeFiles/cryptopp-object.dir/tftables.cpp.o
[ 79%] Building CXX object CMakeFiles/cryptopp-object.dir/tiger.cpp.o
[ 79%] Building CXX object CMakeFiles/cryptopp-object.dir/tigertab.cpp.o
[ 80%] Building CXX object CMakeFiles/cryptopp-object.dir/trdlocal.cpp.o
[ 81%] Building CXX object CMakeFiles/cryptopp-object.dir/ttmac.cpp.o
[ 82%] Building CXX object CMakeFiles/cryptopp-object.dir/twofish.cpp.o
[ 82%] Building CXX object CMakeFiles/cryptopp-object.dir/vmac.cpp.o
[ 83%] Building CXX object CMakeFiles/cryptopp-object.dir/wait.cpp.o
[ 84%] Building CXX object CMakeFiles/cryptopp-object.dir/wake.cpp.o
[ 84%] Building CXX object CMakeFiles/cryptopp-object.dir/whrlpool.cpp.o
[ 85%] Building CXX object CMakeFiles/cryptopp-object.dir/xtr.cpp.o
[ 86%] Building CXX object CMakeFiles/cryptopp-object.dir/xtrcrypt.cpp.o
[ 87%] Building CXX object CMakeFiles/cryptopp-object.dir/zdeflate.cpp.o
[ 87%] Building CXX object CMakeFiles/cryptopp-object.dir/zinflate.cpp.o
[ 88%] Building CXX object CMakeFiles/cryptopp-object.dir/zlib.cpp.o
[ 88%] Built target cryptopp-object
Scanning dependencies of target cryptopp-static
[ 89%] Linking CXX static library libcryptopp.a
/opt/local/bin/ranlib: file: libcryptopp.a(algebra.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(dh.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(eccrypto.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(elgamal.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(eprecomp.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(mqv.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(polynomi.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(strciphr.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(algebra.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(dh.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(eccrypto.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(elgamal.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(eprecomp.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(mqv.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(polynomi.cpp.o) has no symbols
/opt/local/bin/ranlib: file: libcryptopp.a(strciphr.cpp.o) has no symbols
[ 89%] Built target cryptopp-static
Scanning dependencies of target cryptest
[ 89%] Building CXX object CMakeFiles/cryptest.dir/test.cpp.o
[ 90%] Building CXX object CMakeFiles/cryptest.dir/bench1.cpp.o
[ 91%] Building CXX object CMakeFiles/cryptest.dir/bench2.cpp.o
[ 91%] Building CXX object CMakeFiles/cryptest.dir/validat0.cpp.o
[ 92%] Building CXX object CMakeFiles/cryptest.dir/validat1.cpp.o
[ 93%] Building CXX object CMakeFiles/cryptest.dir/validat2.cpp.o
[ 94%] Building CXX object CMakeFiles/cryptest.dir/validat3.cpp.o
[ 94%] Building CXX object CMakeFiles/cryptest.dir/adhoc.cpp.o
[ 95%] Building CXX object CMakeFiles/cryptest.dir/datatest.cpp.o
[ 96%] Building CXX object CMakeFiles/cryptest.dir/regtest.cpp.o
[ 96%] Building CXX object CMakeFiles/cryptest.dir/fipsalgt.cpp.o
[ 97%] Building CXX object CMakeFiles/cryptest.dir/dlltest.cpp.o
[ 98%] Building CXX object CMakeFiles/cryptest.dir/fipstest.cpp.o
[ 99%] Linking CXX executable cryptest.exe
[ 99%] Built target cryptest
Scanning dependencies of target cryptopp-shared
[100%] Linking CXX shared library libcryptopp.dylib
[100%] Built target cryptopp-shared
Running tests...
Test project /Users/uri/src/cryptopp/build
    Start 1: build_cryptest
1/2 Test #1: build_cryptest ...................   Passed    0.34 sec
    Start 2: cryptest
2/2 Test #2: cryptest .........................   Passed    3.35 sec

100% tests passed, 0 tests failed out of 2

Total Test time (real) =   3.69 sec
$ li
CMakeCache.txt                 TestVectors/                   libcryptopp.5.7.dylib*
CMakeFiles/                    Testing/                       libcryptopp.a
CTestTestfile.cmake            cmake_install.cmake            libcryptopp.dylib@
Makefile                       cryptest.exe*
TestData/                      cryptopp-config-version.cmake
$ otool -L cryptest.exe
cryptest.exe:
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
$ otool -L libcryptopp.dylib
libcryptopp.dylib:
	/Users/uri/src/cryptopp/build/libcryptopp.5.7.dylib (compatibility version 5.7.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
$ type clang
clang is hashed (/opt/local/bin/clang)
$ clang -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ clang++ -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$

We do care for cmake (to an extent), and we do care for Xcode (a lot). But I for one cannot reproduce your problem.

P.S. Off-hand, the proposed change in #357 doesn't seem dangerous, so it should be OK to merge. But I'd like to see some more evidence that it is necessary.

@HeinrichJanzing
Copy link
Author

HeinrichJanzing commented Jan 9, 2017

@mouse07410 The build for which you provide a log uses the Makefile generator, not Xcode. Here are my logs:

$ cmake -G "Xcode" ../../
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Compiler:
-- Flags:  -march=native
-- Build type:
--
-- The following OPTIONAL packages have been found:

 * Threads

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/***/Source/cryptopp/builds/osx

$ cmake --build . --config Release --target cryptopp-shared

... a lot of compiler statements here ending with cryptopp-object target succeeding ...

=== BUILD TARGET cryptopp-shared OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-shared.build/Script-51E78D2770CA42D1AAF88B9C.sh
chmod 0755 /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-shared.build/Script-51E78D2770CA42D1AAF88B9C.sh

PhaseScriptExecution CMake\ PostBuild\ Rules builds/osx/cryptopp.build/Release/cryptopp-shared.build/Script-51E78D2770CA42D1AAF88B9C.sh
    cd /Users/***/Source/cryptopp
    /bin/sh -c /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-shared.build/Script-51E78D2770CA42D1AAF88B9C.sh
echo "Creating symlinks"
Creating symlinks
/opt/local/bin/cmake -E cmake_symlink_library /Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.5.6.dylib /Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.5.6.dylib /Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.dylib
CMake Error: cmake_symlink_library: System Error: No such file or directory
make: *** [cryptopp-shared_buildpart_0] Error 1

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution CMake\ PostBuild\ Rules builds/osx/cryptopp.build/Release/cryptopp-shared.build/Script-51E78D2770CA42D1AAF88B9C.sh
(1 failure)

@noloader
Copy link
Collaborator

noloader commented Jan 10, 2017

@HeinrichJanzing,

I can't duplicate the issue, but I suspect I am doing something wrong:

$ cmake -G "Xcode" ../cryptopp
-- The C compiler identification is AppleClang 6.0.0.6000057
-- The CXX compiler identification is AppleClang 6.0.0.6000057
...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jwalton/cmake-build

And then:

$ make cryptopp-shared VERBOSE=1
make: *** No rule to make target 'cryptopp-shared'.  Stop.
$ make shared VERBOSE=1
make: *** No rule to make target 'shared'.  Stop.
$ make dynamic VERBOSE=1
make: *** No rule to make target 'dynamic'.  Stop.

Would you be able to get Cmake display the output rather than hiding the commands?

@HeinrichJanzing
Copy link
Author

HeinrichJanzing commented Jan 11, 2017

@noloader You are telling cmake to generate an Xcode project (by means of the -G "Xcode" option) rather than a makefile. As such the build itself needs to happen using xcodebuild directly or via the cmake build wrapper functionality (as I do in my log: cmake --build . --target ...). The direct call for cryptest would be something like xcodebuild -project cryptopp.xcodeproj/ -target cryptest -config Release. You should see the link fail with

clang: error: no such file or directory: '/Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.a'

There is no useful output for the cryptopp-static target itself. It seems xcodebuild doesn't even invoke any commands for it - unless it has the dummy source file:

=== BUILD TARGET cryptopp-static OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

** BUILD SUCCEEDED **

After digging a bit it seems that adding the dummy CPP file results in the addition of a single attribute in the target build settings (PFE_FILE_C_DIALECTS = c++) though adding only this attribute doesn't fix the problem. After adding the dummy cpp file it looks like this:

$ cmake --build . --config Release --target cryptest
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/ZERO_CHECK.build/Script-17DEE029023A474BA0828DCF.sh
chmod 0755 /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/ZERO_CHECK.build/Script-17DEE029023A474BA0828DCF.sh

PhaseScriptExecution CMake\ Rules builds/osx/cryptopp.build/Release/ZERO_CHECK.build/Script-17DEE029023A474BA0828DCF.sh
    cd /Users/***/Source/cryptopp
    /bin/sh -c /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/ZERO_CHECK.build/Script-17DEE029023A474BA0828DCF.sh
echo ""

make -f /Users/***/Source/cryptopp/builds/osx/CMakeScripts/ReRunCMake.make
make[1]: `/Users/***/Source/cryptopp/builds/osx/CMakeFiles/cmake.check_cache' is up to date.

=== BUILD TARGET cryptopp-object OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

=== BUILD TARGET cryptopp-static OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
/bin/mkdir -p /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64
write-file /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/cryptopp.LinkFileList

CompileC builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/empty.o builds/osx/empty.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/***/Source/cryptopp
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=103 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR=\"Release\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.11 -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -I/Users/***/Source/cryptopp/builds/osx/Release/include -I/Users/***/Source/cryptopp -I/Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/DerivedSources/x86_64 -I/Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/***/Source/cryptopp/builds/osx/Release -march=native -DNDEBUG -fPIC -MMD -MT dependencies -MF /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/empty.d --serialize-diagnostics /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/empty.dia -c /Users/***/Source/cryptopp/builds/osx/empty.cpp -o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/empty.o

Libtool builds/osx/Release/libcryptopp.a normal x86_64
    cd /Users/***/Source/cryptopp
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -L/Users/***/Source/cryptopp/builds/osx/Release -filelist /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/cryptopp.LinkFileList /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/cryptlib.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/cpu.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/integer.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/3way.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/adler32.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/algebra.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/algparam.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/arc4.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/asn.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/authenc.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/base32.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/base64.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/basecode.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/bfinit.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/blake2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/blowfish.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/blumshub.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/camellia.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/cast.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/casts.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/cbcmac.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ccm.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/chacha.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/channels.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/cmac.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/crc.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/default.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/des.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dessp.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dh.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dh2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dll.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dsa.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/eax.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ec2n.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/eccrypto.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ecp.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/elgamal.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/emsa2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/eprecomp.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/esign.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/files.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/filters.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/fips140.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gcm.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gf256.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gf2_32.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gf2n.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gfpcrypt.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gost.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/gzip.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/hex.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/hmac.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/hrtimer.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ida.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/idea.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/iterhash.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/keccak.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/luc.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/mars.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/marss.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/md2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/md4.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/md5.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/misc.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/modes.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/mqueue.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/mqv.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/nbtheory.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/network.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/oaep.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/osrng.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/panama.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/pkcspad.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/polynomi.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/pssr.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/pubkey.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/queue.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rabin.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/randpool.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rc2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rc5.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rc6.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rdrand.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rdtables.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rijndael.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ripemd.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rng.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rsa.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/rw.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/safer.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/salsa.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/seal.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/seed.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/serpent.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/sha.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/sha3.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/shacal2.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/shark.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/sharkbox.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/skipjack.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/socketft.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/sosemanuk.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/square.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/squaretb.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/strciphr.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/tea.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/tftables.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/tiger.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/tigertab.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/trdlocal.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/ttmac.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/twofish.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/vmac.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/wait.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/wake.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/whrlpool.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/xtr.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/xtrcrypt.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/zdeflate.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/zinflate.o /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/zlib.o -o /Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-static.build/Objects-normal/x86_64/empty.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/algebra.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/dh.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/eccrypto.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/elgamal.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/eprecomp.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/mqv.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/polynomi.o has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptopp-object.build/Objects-normal/x86_64/strciphr.o has no symbols

=== BUILD TARGET cryptest OF PROJECT cryptopp WITH CONFIGURATION Release ===

Check dependencies

Ld builds/osx/Release/cryptest.exe normal x86_64
    cd /Users/***/Source/cryptopp
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -L/Users/***/Source/cryptopp/builds/osx/Release -F/Users/***/Source/cryptopp/builds/osx/Release -filelist /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptest.build/Objects-normal/x86_64/cryptest.exe.LinkFileList -mmacosx-version-min=10.11 -march=native /Users/***/Source/cryptopp/builds/osx/Release/libcryptopp.a -Xlinker -dependency_info -Xlinker /Users/***/Source/cryptopp/builds/osx/cryptopp.build/Release/cryptest.build/Objects-normal/x86_64/cryptest.exe_dependency_info.dat -o /Users/***/Source/cryptopp/builds/osx/Release/cryptest.exe

** BUILD SUCCEEDED **

@noloader
Copy link
Collaborator

noloader commented Jan 11, 2017

@HeinrichJanzing ,

Ah, OK, I see some of what is going on... Running the xcodebuild command resulted in the build error (thanks for the hint):

xcodebuild -project cryptopp.xcodeproj/ -target cryptest -config Release
...
clang: error: no such file or directory: '/Users/jwalton/build/Release/libcryptopp.a'

** BUILD FAILED **

It appears Cmake/Xcode built a static archive called libcryptopp-object.a, and not libcryptopp.a:

$ ls -al cryptopp.build/Release/cryptopp-object.build/Objects-normal/libcryptopp-object.a
-rw-r--r--  1 jwalton  staff  8336000 Jan 11 13:18 cryptopp.build/Release/cryptopp-object.build/Objects-normal/libcryptopp-object.a
$ nm cryptopp.build/Release/cryptopp-object.build/Objects-normal/libcryptopp-object.a 2>/dev/null | wc -l
   36433

Can you ask Cmake/Xcode to link against libcryptopp-object.a instead of libcryptopp.a? Or is there a way to add one of those Build Phase steps (I think that's what it is called) that copies libcryptopp-object.a to libcryptopp.a?

You should probably file a bug against Cmake. I'm thinking they should probably be doing more for you. That is, they either need to produce an artifact that's properly named; or they need to perform the copy so the expected artifact is available.


Here's more about the symbols in libcryptopp-object.a. It looks about right to me:

$ nm cryptopp.build/Release/cryptopp-object.build/Objects-normal/libcryptopp-object.a 2>/dev/null | c++filt | grep 'CryptoPP' | grep ' T ' | head -16
0000000000000000 T CryptoPP::ThreeWay::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)
0000000000000400 T CryptoPP::ThreeWay::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const
00000000000002b0 T CryptoPP::ThreeWay::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const
00000000000006d0 T non-virtual thunk to CryptoPP::ThreeWay::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const
00000000000003f0 T non-virtual thunk to CryptoPP::ThreeWay::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const
0000000000000140 T CryptoPP::Adler32::TruncatedFinal(unsigned char*, unsigned long)
0000000000000000 T CryptoPP::Adler32::Update(unsigned char const*, unsigned long)
0000000000000210 T CryptoPP::AlgorithmParameters::AlgorithmParameters(CryptoPP::AlgorithmParameters const&)
0000000000000170 T CryptoPP::AlgorithmParameters::AlgorithmParameters()
0000000000000190 T CryptoPP::AlgorithmParameters::AlgorithmParameters(CryptoPP::AlgorithmParameters const&)
0000000000000150 T CryptoPP::AlgorithmParameters::AlgorithmParameters()
0000000000000290 T CryptoPP::AlgorithmParameters::operator=(CryptoPP::AlgorithmParameters const&)
0000000000000080 T CryptoPP::AlgorithmParametersBase::operator=(CryptoPP::AlgorithmParametersBase const&)
00000000000002d0 T CryptoPP::AlgorithmParameters::GetVoidValue(char const*, std::type_info const&, void*) const
0000000000000000 T CryptoPP::CombinedNameValuePairs::GetVoidValue(char const*, std::type_info const&, void*) const
0000000000000090 T CryptoPP::AlgorithmParametersBase::GetVoidValue(char const*, std::type_info const&, void*) const

@noloader
Copy link
Collaborator

noloader commented Jan 11, 2017

@HeinrichJanzing,

Let's see if the folks on Stack Overflow can help: Cmake generated Xcode project does not produce library artifacts? They have some very talented Cmake readers. Hopefully one of them will know what to do.


Here's a few related questions.The first one may be the same as your problem, but there was no analysis, so its hard to tell. We know the library is being built; its just not being copied where it belongs.

@mouse07410
Copy link
Collaborator

I have two points to make (no pun intended :) here.

  1. Any machine that has Xcode, necessarily has make. And IMHO using make is the preferred way of building the library. So if the build does not support every possible twist, I won't lose any sleep over it.
  2. The fix that @HeinrichJanzing proposed seems harmless enough that we could merge it, even though it fixes the path that we don't find particularly useful (though who knows, maybe some day one of us might need that :).

In summary, I'd be OK with merging this fix.

@noloader
Copy link
Collaborator

noloader commented Jan 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants