I want to compile AUDIT_NULL plugin using Visual Studio Express. I have compiled it on windows with mingw like
$>gcc -Iinclude -fPIC -share d -o plugin_example.dll plugin\audit_null\audit_null.c -DMYSQL_DYNAMIC_PLUGIN
successfully.
But I have no idea where to put option MYSQL_DYNAMIC_PLUGIN in VSE2013. I put it in Properties | Configuration | C++ | Additional Parameters like /DMYSQL_DYNAMIC_PLUGIN= and /DMYSQL_DYNAMIC_PLUGIN and MYSQL_DYNAMIC_PLUGIN= and MYSQL_DYNAMIC_PLUGIN, and to Command Line like /DMYSQL_DYNAMIC_PLUGIN= and in some other places but have no effect. I also tried to put definition just into source code but it didn't help.
Related
I want to build Qt 6 with prebuilt MySQL/OpenSSL libs to try out new features, but I have some issues with configure parameters.
For example, I have such configure parameters:
configure.bat -debug -static -static-runtime -confirm-license -opensource -nomake examples -no-ltcg -sql-mysql -openssl-linked -prefix "C:\Test\6.0.0\msvc2019_64"
When I add the -sql-mysql or -openssl-linked parameters I got the following issue:
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:788 (message):
CMake exited with code 1.
Also, I have tried to use -skip qtwebengine, but cmake returns BUILD_qtwebengine not used by the project. Some of the parameters does not translate into cmake properly. Where I can get full list of cmake parameters to build the Qt 6?
[Updated]
I have translated a few parameters to cmake:
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DCMAKE_INSTALL_PREFIX="C:\Test\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
But still can not find any docs how to translate those: -confirm-license -opensource -skip qtwebengine -openssl_linked -sql-mysql
I have previously built MySQL libs by using CMake Option Reference: https://dev.mysql.com/doc/mysql-sourcebuild-excerpt/8.0/en/source-configuration-options.html#cmake-option-reference
Is there any similar reference available for Qt 6? Thank you.
Thanks to lixinwei (https://bugreports.qt.io/browse/QTBUG-89993) the issue is resolved. Now, it successfully finds the OpenSSL and MySQL libs.
Cmake paramaters:
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DOPENSSL_ROOT_DIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_MSVC_STATIC_RT=TRUE -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIRS="C:\MySQL\mysql-5.7.32-winx64\debug\include" -DMySQL_LIBRARIES="C:\MySQL\mysql-5.7.32-winx64\debug\lib\mysqlclientMTd.lib" -DCMAKE_INSTALL_PREFIX="C:\QtStatic\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
list all qt6 features as cmake flags:
find . -name configure.cmake | xargs cat | grep ^qt_feature | cut -d'"' -f2 | sed 's/-/_/g; s/^.*$/ "-DQT_FEATURE_&=ON"/' | tee all-features.txt
head all-features.txt
"-DQT_FEATURE_qtwebengine_build=ON"
"-DQT_FEATURE_qtwebengine_core_build=ON"
"-DQT_FEATURE_qtwebengine_widgets_build=ON"
"-DQT_FEATURE_qtwebengine_quick_build=ON"
cat all-features.txt | grep some_feature
I just installed Octave a few days ago and think I have been installing packages using the "pkg load name" function but never get a confirmation or anything that looks like the software is trying to download them. I also tried pkg install -forge package_name but that doesn't seem to work. Is there a difference between the two calls?
And; How can I know they are downloading? And where can I find a list of them that are?
The download function and automatic package installation in octave 4.2.1 is broken under windows. Nevertheless the standard packets come with the base installation. Just type
pkg list
in the octave console to display all installed packages. In my case the resulting list starts with these lines
Package Name | Version | Installation directory
---------------------+---------+-----------------------
communications | 1.2.1 | C:\Octave\OCTAVE~1.1\share\octave\packages\communications-1.2.1
control | 3.0.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\control-3.0.0
data-smoothing | 1.3.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\data-smoothing-1.3.0
database | 2.4.2 | C:\Octave\OCTAVE~1.1\share\octave\packages\database-2.4.2
dataframe | 1.1.0 | C:\Octave\OCTAVE~1.1\share\octave\packages\dataframe-1.1.0
...
To get package information programmatically use
[dummy,info]=pkg('list');
info is a cell array of structures containing information about the packages. You can e.g. read the information about name and load state:
>> info{1}.name
ans = signal
>> info{1}.loaded
ans = 0
To get help about the package function enter help pgk on the command line. This help is currently (Octave 5.1) not included in the html documentation. That means doc help does NOT display this help page.
octave windows
I recently tried to build my https://github.com/eyalroz/cuda-api-wrappers/ library's examples after switching to another Linux distribution on the same machine. Strangely enough, I encountered a linking issue. The command:
/usr/bin/c++ -Wall -std=c++11 -g CMakeFiles/device_management.dir/examples/by_runtime_api_module/device_management.cpp.o -o examples/bin/device_management -rdynamic lib/libcuda-api-wrappers.a -Wl,-Bstatic -lcudart_static -Wl,-Bdynamic -lpthread -ldl -lrt
fails to find the CUDA runtime library, and I get:
CMakeFiles/device_management.dir/examples/by_runtime_api_module/device_management.cpp.o: In function `cuda::device::peer_to_peer::get_attribute(cudaDeviceP2PAttr, int, int)':
/home/eyalroz/src/mine/cuda-api-wrappers/src/cuda/api/device.hpp:38: undefined reference to `cudaDeviceGetP2PAttribute'
collect2: error: ld returned 1 exit status
but if I add -L/usr/local/cuda/lib64 it builds fine. This didn't use to happen before; and it doesn't happen on another machine I've checked on, nor does it even happen to other targets using the CUDA runtime in the same CMakeLists.txt (like version_managament).
FindCUDA seems to be finding everything, as the value of ${CUDA_LIBRARIES} is /usr/local/cuda/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so. And the target lines in CMakeLists.txt are:
add_executable(device_management EXCLUDE_FROM_ALL examples/by_runtime_api_module/device_management.cpp)
target_link_libraries(device_management cuda-api-wrappers ${CUDA_LIBRARIES})
as is suggested in answers to other related questions (e.g. here). Why is this happening? Should I "manually" add the -L switch?
Edit: Following #RobertCrovella's suggestion, here are the ld search paths:
$ gcc -print-search-dirs | sed '/^lib/b 1;d;:1;s,/[^/.][^/]*/\.\./,/,;t 1;s,:[^=]*=,:;,;s,;,; ,g' | tr \; \\012 | tr ':' "\n" | tail -n +3
/usr/local/cuda/lib64/x86_64-linux-gnu/5/
/usr/local/cuda/lib64/x86_64-linux-gnu/
/usr/local/cuda/lib/
/usr/lib/gcc/x86_64-linux-gnu/5/
/usr/x86_64-linux-gnu/lib/x86_64-linux-gnu/5/
/usr/x86_64-linux-gnu/lib/x86_64-linux-gnu/
/usr/x86_64-linux-gnu/lib/
/usr/lib/x86_64-linux-gnu/5/
/usr/lib/x86_64-linux-gnu/
/usr/lib/
/lib/x86_64-linux-gnu/5/
/lib/x86_64-linux-gnu/
/lib/
/usr/lib/x86_64-linux-gnu/5/
/usr/lib/x86_64-linux-gnu/
/usr/lib/
/usr/local/cuda/lib64/
/usr/x86_64-linux-gnu/lib/
/usr/lib/
/lib/
/usr/lib/
$ ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012
SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu")
SEARCH_DIR("=/lib/x86_64-linux-gnu")
SEARCH_DIR("=/usr/lib/x86_64-linux-gnu")
SEARCH_DIR("=/usr/local/lib64")
SEARCH_DIR("=/lib64")
SEARCH_DIR("=/usr/lib64")
SEARCH_DIR("=/usr/local/lib")
SEARCH_DIR("=/lib")
SEARCH_DIR("=/usr/lib")
SEARCH_DIR("=/usr/x86_64-linux-gnu/lib64")
SEARCH_DIR("=/usr/x86_64-linux-gnu/lib")
Notes:
Yes, I know the CMakeLists.txt there is ugly.
TL;DR:
After the FindCUDA invocation, add the lines:
get_filename_component(CUDA_LIBRARY_DIR ${CUDA_CUDART_LIBRARY} DIRECTORY)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-L${CUDA_LIBRARY_DIR}")
and building should succeed on both systems.
Discussion:
(Paraphrasing #RobertCrovella and myself in the comments:)
OP was expecting, that if the following hold:
FindCUDA succeeds
${CUDA_LIBRARIES} includes a valid full path to either the static or the dynamic CUDA runtime library
the library dependency is indicated using target_link_libraries(relevant_target ${CUDA_LIBRARIES})
... then the CMake-based build he was attempting should succeed on a variety of valid CUDA installations. That is (unfortunately) not the case, since while FindCUDA does locate the CUDA library path, it does not actually make your linker search that path. So a failure should actually be expected. The build had worked on OP's old system due to a "fluke", or rather, due to OP having added the CUDA library directory to the linker's search path, somehow, apriori.
The linking command must be issued with the -L/path/to/cuda/libraries switch, so that the linker knows where to looks for the (unspecified-path) libraries referred to be the CUDA-related -l switches (in OP's case, -lcudart_static).
This answer discusses how to do that in CMake for different kinds of targets. You might also want to have a look at man gcc (the GCC manual page, also available here) regarding the -l and -L options, if you are not familiar with them.
I'm using Eclipse Juno CDT.
I added the following to my project:
the mysql/includes path to the includes path setting
the libmysql.lib and zlib.lib to libraries setting
the mysql library path to the library paths setting
Now, when I make my project, the compilation throws an error when I run the application.
This is the build:
10:08:56 **** Build of configuration Debug for project mysqlapp ****
make all
Building file: ../src/mysqlapp.c
Invoking: Cygwin C Compiler
gcc -I"C:\Program Files\MySQL\MySQL Connector C 6.0.2\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/mysqlapp.d" -MT"src/mysqlapp.d" -o "src/mysqlapp.o" "../src/mysqlapp.c"
cygwin warning:
MS-DOS style path detected: C:\Users\Yonaton\workspace\mysqlapp\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Yonaton/workspace/mysqlapp/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building: ../src/mysqlapp.c
Building target: mysqlapp.exe
Invoking: Cygwin C Linker
gcc -L"C:\Program Files\MySQL\MySQL Connector C 6.0.2\lib\opt" -o "mysqlapp.exe" ./src/mysqlapp.o
Finished building target: mysqlapp.exe
And this is the run within eclipse:
10:09:55 **** Incremental Build of configuration Debug for project mysqlapp ****
make all
src/mysqlapp.d:1: *** multiple target patterns. Stop.
10:09:56 Build Finished (took 225ms)
Under Project->Properties->C/C++ General->Paths and Symbols->Libraries do not add the file name of the library, nor the path.
So if you want to link against /lib64/libz.so just add z.
Or alternativly add the z under Project->Properties->C/C++ Build->Settings->GCC Linker->Libraries.
If the library is not located under a standard path add the custom search path for a library under Project->Properties->C/C++ General->Paths and Symbols->Libraries Paths.
Update (referring "multiple target patterns"):
make does not like DOS paths. In the .d file a : after the drive letter is interpreted as target delimiter.
Switch to UNIX paths (as you were already told to do ... ;-)).
(see also: "multiple target patterns" Makefile error)
If I remember correctly "-l" ( small L) before your libraries.
I have this problem with freeradius module.
I'm trying to add my custom module, but after I launch radius server in debug mode it shows me this error:
/usr/local/etc/raddb/modules/m2[2]: Failed to link to module 'rlm_m2': libmysql.so.16: cannot open shared object file: No such file or directory
/usr/local/etc/raddb/sites-enabled/default[224]: Failed to load module "m2".
/usr/local/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section.
My system is Ubuntu 12, all mysql packages are installed correctly(there does exist libmysql.so.16 in usr/lib/mysql) freeradius runs smoothly with default parameters and so on. I really don't have an idea what exactly can't find this mysql library or how to show it to it.
Try compile like this:
gcc -I/usr/include/mysql rlm_m2.c -o rlm_m2 -lmysqlclient -lnsl -lm -lz\
-L/usr/lib/mysql -L/usr/lib/mysql -L/usr/lib64/mysql