Compile Error While Building MySQL connector from sources - mysql

I'm building MySQL C connector 6.1.0 for my Visual Studio 10. It does compile fine for 32-bit after the following steps:
Launch Visual Studio Command Prompt (as Administrator!).
cmake . -G "Visual Studio 10"
devenv libmysql.sln /build Release
for the debug:
cmake . -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Debug
devenv libmysql.sln /Rebuild Debug
But if I try to build it for 64-bit architecture using "cmake . -G "Visual Studio 10 Win64" compiler fires an error:
11>my_atomic.c(30): error C2118: negative subscript
for the following line of code:
compile_time_assert(sizeof(intptr) == sizeof(void *));
My intuition suggests, that the compiler didn't doesn't compile it for the 64-bit. Trying to pass such parameters to cmake doesn't help:
cmake . -G "Visual Studio 10 Win64" -DCMAKE_C_FLAGS="-m64" -DCMAKE_CXX_FLAGS="-m64"
One more remark: the file "my_atomic.c" belongs to the project "mysys" and it is being compiled as C code (/TC option under Configuration Properties->C/C++->Advanced.
Any ideas?

My own fault: for 64-bit have to run Visual Studio x64 Win64 Command Prompt !

Related

nvprof command error: cupti64_102.dll was not found

When I try to run nvprof command in Command Prompt, System Erros pops up and says "The code execution cannot proceed because cupti64_102.dll was not found. Reinstall the program may fix this problem."
I have installed the CUDA Toolkit 10.2 but cupti64_102.dll is not in /bin.
System: Windows 10, Quadro K4200, CUDA10.2, CUDA Toolkit 10.2
Just go to Environment Variables select path
Add the following string to your path
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\extras\CUPTI\lib64
then nvprof will work as intended.

Octave can't find JRE while I have installed JRE

I have installed JRE successfully:
However, Octave keeps showing that it can't find JRE.
Make sure you installed right architecture(x86 or x64) of jre, it fixed the issue for me.
Following https://octave.1599824.n4.nabble.com/Octave-4-installer-doesn-t-detect-JRE-at-install-time-td4670684.html and: https://superuser.com/questions/1382158/on-windows-why-java-version-return-error-opening-registry-key-software-javas
run regedit.exe as Admin
change CurrentVersion in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\ to 12.0.2
create: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2
set JavaHome in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2\ to: C:\Program Files\Java\jdk-12.0.2
open cmd and type: java -version
in case of error type: where java
cmd will return folder or few; in explorer go to the one ending with \javapath for example C:\Program Files (x86)\Common Files\Oracle\Java\javapath
there should be files: java.exe javaw.exe and javaws.exe
if so delete them, reopen cmd and type java -version
Now it should display correct version without errors
In Octave type javachk jvm
if ans is empty java should be working now
From the screenshot you presented, you have the JDK (development kit) installed, not the JRE (runtime environment). The required commands you need are there, but the operating system does not recognize this automatically. For that, you must include the 'java/bin' directory from the JDK in the PATH environment variable for your system. Next time you run Octave, it will locate and recognize the Java environment.

Compile QEMU under Windows 10 (64-bit) for Windows 10 (64-bit)

I managed to compile QEMU (3.0.50) under Windows 10 (64-bit) (basically following these instructions) with these commands:
./configure --enable-gtk --enable-sdl
make
However, when starting qemu-system-x86_64.exe in a console, nothing happens. I expected a window showing up. Shortly after starting the exe, I'm getting back the prompt. Nothing printed out to the console. No necessary DLL is missing. What could be the problem?
Finally I managed to compile and run QEMU under Windows 10 Home 64-bit.
There are a few pitfalls:
Due to a compiler bug in mingw (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86832 and https://www.mail-archive.com/qemu-devel#nongnu.org/msg557409.html), you have to configure QEMU with --disable-stack-protector and (one solution) add the function __stack_chk_fail to a source file.
Configure QEMU with --disable-werror.
Remove Capstone project from makefile.
Here's a complete step-by-step guide for compiling qemu-system-x86_64.exe:
Date: 2018-10-31
OS: Microsoft Windows 10 Home 64-bit
Guide based on: https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2
Download and install msys2 to C:\msys64:
http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe
Start C:\msys64\mingw64.exe
Updates (then close window and restart mingw64.exe): pacman -Syu
Updates: pacman -Su
Install basic packets: pacman -S base-devel mingw-w64-x86_64-toolchain git python
Install QEMU specific packets: pacman -S mingw-w64-x86_64-glib2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-SDL2
Get QEMU sources:
git clone git://git.qemu-project.org/qemu.git
cd qemu
git submodule update --init ui/keycodemapdb
git submodule update --init capstone
git submodule update --init dtc
Insert
void __stack_chk_fail(void);
void __stack_chk_fail(void)
{
}
to qemu\util\oslib-win32.c
e.g. at line 44
Comment out (#) Capstone (line 508) in qemu\Makefile
Build QEMU:
./configure --enable-gtk --enable-sdl --target-list=x86_64-softmmu --disable-werror --disable-stack-protector
make
Run in qemu/x86_64-softmmu
./qemu-system-x86_64 -L ./../pc-bios
Optional (for better performance): Install HAXM according to this guide: https://www.qemu.org/2017/11/22/haxm-usage-windows/ and start QEMU with option -accel hax
I would do know if somebody tried in 2022 i have currently some issues after compiling.
Firt it asks for libzstd.dll, when i go to the project i found by google and dl this dll, i encounter another issue
with x64.dll
with x32.dll (just in case)
i use msys2 minGw x64 on windows 10 pro x64. At the beginning i would compile a patch, but it the same problem with vanilla, i ask myself if it's an environment problem, a missing dll, or if it's always possible to compile directly on windows10, perhaps now it's only possible to compile in cross platform. I'm not habit at all with mingw64 tools.
I looked for the g_spanw... error and found this https://docs.gtk.org/glib/func.spawn_async_with_fds.html
Perhaps i'm wrong but it's only for gnome, isn't it ?

Installing cuda via brew and dmg

After attempting to install nvidia toolkit on MAC by following guide : http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#axzz4FPTBCf7X I received error "Package manifest parsing error" which led me to this : NVidia CUDA toolkit 7.5.27 failing to install on OS X . I unmounted the dmg and upshot was that instead of receiving "Package manifest parsing error" the installer would not launch (it seemed to launch briefly , then quit).
Installing via command brew install Caskroom/cask/cuda (CUDA 7.5 install on Mac missing nvrtc) seems to have successfully installed cuda.
command nvcc --version returns :
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Apr_11_13:23:40_CDT_2016
Cuda compilation tools, release 7.5, V7.5.26
I've built the example in /Developer/NVIDIA/CUDA-7.5/samples/1_Utilities with :
make -C bandwidthTest/
This executed without error.
It appears installing with brew install Caskroom/cask/cuda is safe method of installing ? What is difference between this install method and installing via DMG file from nvidia ?
Caskroom appears to be an extension for brew for installing GUI applications : https://github.com/caskroom/homebrew-cask
Should an IDE also be installed as part of the cuda install ?
Nowadays you have to do the following to install cuda via brew:
brew tap homebrew/cask-drivers
brew cask install nvidia-cuda
See https://github.com/caskroom/homebrew-cask/issues/38325 .
Then you also need to add the following to your file ~/.bash_profile:
export PATH=/Developer/NVIDIA/CUDA-9.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
See http://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html.
UPDATE: Newer versions of Mac OS X with activated SIP (System integrity protection) will prevent modifying the DYLD_LIBRARY_PATH (see https://groups.google.com/forum/#!topic/caffe-users/waugt62RQMU). You can check that via
source ~/.bash_profile
env | grep DYLD_LIBRARY_PATH
If the output of this command is empty SIP is active and you might want to deactivate it as described at https://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html . After doing this you should see
env | grep DYLD_LIBRARY_PATH
DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.0/lib
Both methods download and install from the same .dmg file from NVidia.
The homebrew-cask framework is the preferred method for installing software distributed as binaries in the homebrew paradigm.
This is my understanding.
Using DMG file, follow below:
wget 'https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_mac.dmg' && \
hdiutil attach cuda_10.2.89_mac.dmg \
-nobrowse \
-mountpoint \
/Volumes/CUDAMacOSXInstaller
Open installer:
open /Volumes/CUDAMacOSXInstaller/CUDAMacOSXInstaller.app
Uncheck "CUDA Samples" before continue.
Unmount and remove file:
hdiutil detach /Volumes/CUDAMacOSXInstaller && rm ./cuda_10.2.89_mac.dmg

Error compiling CUDA from Command Prompt

I'm trying to compile a cuda test program on Windows 7 via Command Prompt,
I'm this command:
nvcc test.cu
But all I get is this error:
nvcc fatal : Cannot find compiler 'cl.exe' in PATH
What may be causing this error?
You will need to add the folder containing the "cl.exe" file to your path environment variable. For example:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
Edit: Ok, go to My Computer -> Properties -> Advanced System Settings -> Environment Variables. Here look for "PATH" in the list, and add the path above (or whatever is the location of your cl.exe).
For new Visual Studio cl.exe is present in path => C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64
x64 is for 64bit
x86 is for 32bit
Solve this problem by adding this options to nvcc
nvcc x.cu ... -ccbin "D:\Program Files\Microsoft Visual Studio 11.0\VC\bin"
for example my compiler is VS2012. and cl.exe is in this dir
cl.exe is Microsoft's C/C++ compiler. So the problem is that you don't have that installed where the command line can find it.
nvcc is only a front end for the CUDA specific part of the program. It must invoke a full compiler to finish the job. In this case it cannot find the Visual Studio compiler 'cl.exe'
Check paths, nvcc documentation etc.
I see that this is an old question but I recently got this error on my Visual Studio 2012 when I tried to build my CUDA project. Apparently I had changed my CUDA project to the Nov 2012 pack, changing it back to the v110 that it usually is by default fixed this error.
In Visual Studio, left click on the CUDA project, ->properties->Configuration Properties-> General -> Platform toolset, and choose: Visual Studio 2012 (v110).
I could probably get it to work with the Nov 2012 pack, but the CUDA code does not use any of the additional functions of that pack, so it is not necessary. (That pack contains the variadic templates for C++11.)
Solve this problem by adding the path to environment variables, which can vary slightly depending in the version of visual studio installed in your system, and are you using 32bit or 64bit system
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64