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

Failed to build on FreeBSD #72

Open
Curculigo opened this issue Aug 9, 2024 · 4 comments
Open

Failed to build on FreeBSD #72

Curculigo opened this issue Aug 9, 2024 · 4 comments

Comments

@Curculigo
Copy link

$ cmake -S . -B build
ASIO2_ROOT_DIR = /work/asio2
-- The C compiler identification is Clang 18.1.5
-- The CXX compiler identification is Clang 18.1.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_BUILD_TYPE is not set, Set default build to Release.
CMAKE_BUILD_TYPE = Release
ASIO2_LIBS_DIR = 
ASIO2_EXES_DIR = /work/asio2/bin/x64
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done (7.3s)
-- Generating done (0.2s)
-- Build files have been written to: /work/asio2/build
$ gmake -C build
gmake: Entering directory '/work/asio2/build'
[  1%] Building CXX object example/http/client/CMakeFiles/http_client.dir/http_client.cpp.o
In file included from /work/asio2/example/http/client/http_client.cpp:1:
In file included from /work/asio2/include/asio2/http/http_client.hpp:22:
In file included from /work/asio2/include/asio2/tcp/tcp_client.hpp:20:
In file included from /work/asio2/include/asio2/base/client.hpp:27:
In file included from /work/asio2/include/asio2/base/iopool.hpp:30:
In file included from /work/asio2/include/asio2/base/error.hpp:31:
In file included from /work/asio2/include/asio2/external/asio.hpp:36:
In file included from /work/asio2/3rd/asio.hpp:18:
In file included from /work/asio2/3rd/asio/any_completion_executor.hpp:22:
In file included from /work/asio2/3rd/asio/execution.hpp:22:
In file included from /work/asio2/3rd/asio/execution/blocking_adaptation.hpp:20:
In file included from /work/asio2/3rd/asio/detail/mutex.hpp:25:
/work/asio2/3rd/asio/detail/posix_mutex.hpp:52:3: warning: mutex 'mutex_' is still held at the end of function [-Wthread-safety-analysis]
   52 |   }
      |   ^
/work/asio2/3rd/asio/detail/posix_mutex.hpp:51:11: note: mutex acquired here
   51 |     (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL.
      |           ^
/work/asio2/3rd/asio/detail/posix_mutex.hpp:57:11: warning: releasing mutex 'mutex_' that was not held [-Wthread-safety-analysis]
   57 |     (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL.
      |           ^
In file included from /work/asio2/example/http/client/http_client.cpp:1:
In file included from /work/asio2/include/asio2/http/http_client.hpp:22:
In file included from /work/asio2/include/asio2/tcp/tcp_client.hpp:20:
In file included from /work/asio2/include/asio2/base/client.hpp:27:
In file included from /work/asio2/include/asio2/base/iopool.hpp:30:
In file included from /work/asio2/include/asio2/base/error.hpp:31:
In file included from /work/asio2/include/asio2/external/asio.hpp:36:
In file included from /work/asio2/3rd/asio.hpp:39:
In file included from /work/asio2/3rd/asio/basic_signal_set.hpp:25:
In file included from /work/asio2/3rd/asio/detail/signal_set_service.hpp:289:
In file included from /work/asio2/3rd/asio/detail/impl/signal_set_service.ipp:24:
In file included from /work/asio2/3rd/asio/detail/static_mutex.hpp:25:
/work/asio2/3rd/asio/detail/posix_static_mutex.hpp:44:3: warning: mutex 'mutex_' is still held at the end of function [-Wthread-safety-analysis]
   44 |   }
      |   ^
/work/asio2/3rd/asio/detail/posix_static_mutex.hpp:43:11: note: mutex acquired here
   43 |     (void)::pthread_mutex_lock(&mutex_); // Ignore EINVAL.
      |           ^
/work/asio2/3rd/asio/detail/posix_static_mutex.hpp:49:11: warning: releasing mutex 'mutex_' that was not held [-Wthread-safety-analysis]
   49 |     (void)::pthread_mutex_unlock(&mutex_); // Ignore EINVAL.
      |           ^
In file included from /work/asio2/example/http/client/http_client.cpp:1:
In file included from /work/asio2/include/asio2/http/http_client.hpp:22:
In file included from /work/asio2/include/asio2/tcp/tcp_client.hpp:20:
In file included from /work/asio2/include/asio2/base/client.hpp:27:
In file included from /work/asio2/include/asio2/base/iopool.hpp:30:
In file included from /work/asio2/include/asio2/base/error.hpp:31:
In file included from /work/asio2/include/asio2/external/asio.hpp:36:
In file included from /work/asio2/3rd/asio.hpp:18:
In file included from /work/asio2/3rd/asio/any_completion_executor.hpp:22:
In file included from /work/asio2/3rd/asio/execution.hpp:22:
In file included from /work/asio2/3rd/asio/execution/blocking_adaptation.hpp:19:
In file included from /work/asio2/3rd/asio/detail/event.hpp:25:
/work/asio2/3rd/asio/detail/posix_event.hpp:118:7: warning: calling function 'pthread_cond_wait' requires holding mutex 'lock.mutex().mutex_' exclusively [-Wthread-safety-analysis]
  118 |       ::pthread_cond_wait(&cond_, &lock.mutex().mutex_); // Ignore EINVAL.
      |       ^
/work/asio2/3rd/asio/detail/conditionally_enabled_event.hpp:96:14: note: in instantiation of function template specialization 'asio::detail::posix_event::wait<asio::detail::conditionally_enabled_mutex::scoped_lock>' requested here
   96 |       event_.wait(lock);
      |              ^
In file included from /work/asio2/example/http/client/http_client.cpp:1:
In file included from /work/asio2/include/asio2/http/http_client.hpp:22:
In file included from /work/asio2/include/asio2/tcp/tcp_client.hpp:20:
In file included from /work/asio2/include/asio2/base/client.hpp:27:
In file included from /work/asio2/include/asio2/base/iopool.hpp:30:
In file included from /work/asio2/include/asio2/base/error.hpp:31:
In file included from /work/asio2/include/asio2/external/asio.hpp:36:
In file included from /work/asio2/3rd/asio.hpp:18:
In file included from /work/asio2/3rd/asio/any_completion_executor.hpp:22:
In file included from /work/asio2/3rd/asio/execution.hpp:22:
In file included from /work/asio2/3rd/asio/execution/blocking_adaptation.hpp:19:
In file included from /work/asio2/3rd/asio/detail/event.hpp:25:
/work/asio2/3rd/asio/detail/posix_event.hpp:148:9: warning: calling function 'pthread_cond_timedwait' requires holding mutex 'lock.mutex().mutex_' exclusively [-Wthread-safety-analysis]
  148 |         ::pthread_cond_timedwait(&cond_,
      |         ^
/work/asio2/3rd/asio/detail/conditionally_enabled_event.hpp:106:21: note: in instantiation of function template specialization 'asio::detail::posix_event::wait_for_usec<asio::detail::conditionally_enabled_mutex::scoped_lock>' requested here
  106 |       return event_.wait_for_usec(lock, usec);
      |                     ^
6 warnings generated.
[  1%] Linking CXX executable /work/asio2/bin/x64/http_client
ld: error: unable to find library -lstdc++fs
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [example/http/client/CMakeFiles/http_client.dir/build.make:97: /work/asio2/bin/x64/http_client] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1578: example/http/client/CMakeFiles/http_client.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2
gmake: Leaving directory '/work/asio2/build'
@zhllxt
Copy link
Owner

zhllxt commented Aug 10, 2024

Try remove the "stdc++fs" from CMakeLists.txt

QQ20240810-154740

@Curculigo
Copy link
Author

The problem with -lstdc++fs is solved. Other problems arise (related to OpenSSL).

@zhllxt
Copy link
Owner

zhllxt commented Aug 12, 2024

You may need to compile openssl under FreeBSD by yourself

@Curculigo
Copy link
Author

Curculigo commented Aug 15, 2024

You may need to compile openssl under FreeBSD by yourself

Why can't I use system's OpenSSL? You are using your prebuilt version of OpenSSL included in the repository even on Linux. What's wrong with the system OpenSSL? I think the prebuilt OpenSSL is for Windows users?

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