compilation

How should a very simple Makefile look like for Cuda compiling under linux

懵懂的女人 提交于 2019-12-03 09:34:49
问题 I want to compile a very basic hello world level Cuda program under Linux. I have three files: the kernel: helloWorld.cu main method: helloWorld.cpp common header: helloWorld.h Could you write me a simple Makefile to compile this with nvcc and g++? Thanks, Gabor 回答1: Just in case, here's my variant. I use it to compile CUDA projects on Mac, but I think it will suit Linux too. It requires CUDA SDK. BINDIR = ./ # places compiled binary in current directory EXECUTABLE := helloWorld CCFILES :=

How can I use CodeBlocks with the most recent versions of the VC++ compiler?

末鹿安然 提交于 2019-12-03 09:08:34
I need to use C::B with a recent version of MS VC++ compiler like the ones in VS2015 or VS2017, and eventually future ones, but C::B does not offer such option. The most recent VC++ version that C::B allows the user to choose from its list, in the Settings, is VC++2010 (MSVC++10.0) wich is quite old. After some search I didn't find an explanation to overcome the problem. Not even C::B site offers a solution. How can I do that? asam After some attempts I made with C::B settings and VC++ compilers, I found a solution that is not complicate at all. In this post I will show how to use the latest

How can I get the LLVM IR dump from XLA in TensorFlow?

别等时光非礼了梦想. 提交于 2019-12-03 08:51:41
I am trying to get the LLVM IR generated by the XLA Compiler in TensorFlow. I know that the entire LLVM Context is contained in the llvm_module object. This is then converted to a string with the utility function llvm_ir::DumpModuleToString(*llvm_module) function in the Compile() function in the file: //tensorflow/compiler/xla/service/cpu.cpu_compiler.cc . But I have been trying to log it using VLOG(2) from tensorflow/core/logging.h . No logs are shown. However, the remaining VLOG(2) statements from other files are logged in my Python run. >>> import tensorflow as tf >>> hello = tf.constant(

Compiling PHP with GD and libjpeg support

☆樱花仙子☆ 提交于 2019-12-03 08:40:35
问题 I compile my own PHP, partly to learn more about how PHP is put together, and partly because I'm always finding I need modules that aren't available by default, and this way I have control over that. My problem is that I can't get JPEG support in PHP. Using CentOS 5.6. Here are my configuration options when compiling PHP 5.3.8: './configure' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '-

Problems installing Python 3 with --enable-shared

冷暖自知 提交于 2019-12-03 08:37:54
Problem I'm trying to install Python 3 with the --enable-shared option. Installation "succeeds" but the resulting Python is not runnable. Trying to run Python after installation gives the following error: $ /opt/python3/bin/python3.5 /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory Background The OS is Debian (squeeze), and has a previous installation of Python 2.6, which is necessary to retain because other code relies on it, and Apache 2.2. Ultimately what I'm trying to do is set up Django to run

Python 3.1.1 with --enable-shared : will not build any extensions

白昼怎懂夜的黑 提交于 2019-12-03 08:22:01
Summary: Building Python 3.1 on RHEL 5.3 64 bit with --enable-shared fails to compile all extensions. Building "normal" works fine without any problems. Please note that this question may seem to blur the line between programming and system administration. However, I believe that because it has to deal directly with getting language support in place, and it very much has to do with supporting the process of programming, that I would cross-post it here. Also at: https://serverfault.com/questions/73196/python-3-1-1-with-enable-shared-will-not-build-any-extensions . Thank you! Problem: Building

Why don't C++ compilers optimize away reads and writes to struct data members as opposed to distinct local variables?

孤街醉人 提交于 2019-12-03 08:08:56
I'm trying to create a local array of some POD values (e.g. double ) with fixed max_size that is known at compile time, then read a runtime size value ( size <= max_size ) and process first size elements from that array. The question is, why doesn't compiler eliminate stack reads and writes when arr and size are placed into the same struct / class , as opposed to the case where arr and size are independent local variables? Here's my code: #include <cstddef> constexpr std::size_t max_size = 64; extern void process_value(double& ref_value); void test_distinct_array_and_size(std::size_t size) {

new types may not be defined in a return type - C++

五迷三道 提交于 2019-12-03 08:04:08
问题 I am confused I think on C++ class structure. I have a .h called FxMathFunctions.h and a .cpp called FxMathFunctions.cpp the .h starts like: class FxMathFunctions { public: FxMathFunctions(); ~FxMathFunctions(); and in the .cpp I have: #include "FxBasicTypes.h" #include "FxMathFunctions.h" FxMathFunctions::FxMathFunctions() {} FxMathFunctions::~FxMathFunctions() {} I am getting errors like: error: new types may not be defined in a return type error: return type specification for constructor

Ant rebuilding library projects every time

眉间皱痕 提交于 2019-12-03 07:59:06
I have an Android project that includes two Android Library projects. I'm using the command ant debug to build the project and it takes around 1min and 20sec. I've counted that 17 seconds are used to compile the first android library project and 42 seconds are used to compile the second android library project. Since these two dependency projects are rarely updated it's not necessary to compile them each time. How can I avoid ant compiling the two Android library projects each build? Add dont.do.deps=1 to your local.properties (or pass this property to ant some other way) yorkw This is how

Retrieve plain text script from compiled bash script

血红的双手。 提交于 2019-12-03 07:51:34
Some time ago, i wrote some bash scripts for my school. I thought it would be very clever to 'protect' them, so i compiled them with shc into a binary file. Some weeks later, i lost the uncompiled scripts and now i have only my binarys left. Is there a way to retrieve the scripts back from the shc generated binarys? I looked into the source code of shc to find a way to decompile the binarys with no luck. Using shc to compile your scripts does not protect them. You don't get more security this way. The shc compiled binary decrypts and loads the script into memory when started. You could then,