compilation

Compile parameters for MIPS based codesourcery toolchain?

纵然是瞬间 提交于 2019-12-07 23:59:55
问题 I installed codesourcery cross compile toolchain for mips32 architecture on my WIN 7 machince. I want to first compile a simple 'factorial' binary for my router which is based on MIPS32. From little search on the internet, I found it is based on MIPS32 big-endian. #cat /proc/cpuinfo system type : 96338W2 processor : 0 cpu model : BCM6338 V1.0 BogoMIPS : 239.20 wait instruction : no microsecond timers : yes tlb_entries : 32 extra interrupt vector : yes hardware watchpoint : no unaligned access

rand() issue in C programming? [duplicate]

自作多情 提交于 2019-12-07 23:44:25
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Why do I always get the same sequence of random numbers with rand()? So yeah, this might seem slightly noobish, but since I'm teaching myself C after becoming reasonable at Java, I've already run into some trouble. I'm trying to use the rand() function in C, but I can only call it once, and when it do, it ALWAYS generates the same random number, which is 41. I'm using Microsoft Visual C++ 2010 Express, and I

No such module <product module name> in XCode Unit test

喜夏-厌秋 提交于 2019-12-07 23:21:54
问题 I have a mixed objective-c and Swift project and I try to write Unit tests for it. My project name is: Alphaproject my product module name is: Alphaproject I set to YES Defines Module in my main Target (Alphaproject) and set to YES EnableTestability for Debug only in this same Target. In my Test class, I try to import my product module name: @testable import Alphaproject Additional notes: all my projects files are only part of the main target my test files are only part of the test target My

compiling Cython with MinGW - undefined reference PyExc

大城市里の小女人 提交于 2019-12-07 23:10:15
问题 I'm trying to compile a simple code snippet from the book "Cython - A guide for Python programmers", and when i compile, i get the following error: H:\Cython>python setup.py build_ext -i --compiler=mingw32 running build_ext building 'fib' extension C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Anaconda3\include -IC:\Anaconda3\include -c fib.c -o build\temp.win32-3.4\Release\fib.o writing build\temp.win32-3.4\Release\fib.def C:\MinGW\bin\gcc.exe -shared -s build\temp.win32-3.4\Release\fib.o build

Code generation from three address code to JVM bytecode

a 夏天 提交于 2019-12-07 21:01:59
问题 I'm working on the byte code compiler for Renjin (R for the JVM) and am experimenting with translating our intermediate three address code (TAC) representation to byte code. All the textbooks on compilers that I've consulted discuss register allocation during code generation, but I haven't been able to find any resources for code generation on stack-based virtual machines like the JVM. Simple TAC instructions are trivial to translate into bytecode, but I get a bit lost when temporaries are

How to make libusb library visible to another program?

拥有回忆 提交于 2019-12-07 21:00:28
问题 I am trying to compile hidapi library. In order to compile that, I need libusb-1.0. I've downloaded that, configured, made and installed to /usr/local/lib . But when I try to compile hidapi , it doesn't see libusb-1.0 : cc -Wall -g -c -I../hidapi pkg-config libusb-1.0 --cflags hid-libusb.c -o hid-libusb.o -L/usr/local/lib Package libusb-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb-1.0.pc' to the PKG_CONFIG_PATH environment variable

check if nvcc is available in makefile

青春壹個敷衍的年華 提交于 2019-12-07 19:37:30
问题 I have two versions of a function in an application, one implemented in CUDA and the other in standard C. They're in separate files, let's say cudafunc.h and func.h (the implementations are in cudafunc.cu and func.c ). I'd like to offer two options when compiling the application. If the person has nvcc installed, it'll compile the cudafunc.h . Otherwise, it'll compile func.h . Is there anyway to check if a machine has nvcc installed in the makefile and thus adjust the compiler accordingly?

How to detect WP8 at compilation time

微笑、不失礼 提交于 2019-12-07 19:12:30
问题 I'm developing a cross platform c++ library. I target WP8 among others and I need to detect if the target is WP8 or Desktop Windows. Is there a flag automatically set for WP8 targets? I thought about using _WIN32 but it seems defined on both platforms anyway. 回答1: Not sure if this is what you're looking for but if you're doing a Universal App/Portable library you can detect it by using C++ From winapifamily.h /* * When compiling C and C++ code using SDK header files, the development *

Compile JavaScripts with Gulp and Resolve Dependencies (separate files)

浪尽此生 提交于 2019-12-07 19:01:26
问题 I want to compile JavaScript files with Gulp. I have a src directory where all scripts are present with .js extension. I want all scripts to be compiled separately and placed into a destination directory ( dist ) with the same filename as the original. Consider this example: src/jquery.js : /** * @require ../../vendor/jquery/dist/jquery.js */ src/application.js : /** * @require ../../vendor/angular/angular.js * @require ../../vendor/ngprogress-lite/ngprogress-lite.js * @require ../../vendor

Recording the time when you compile a source

ε祈祈猫儿з 提交于 2019-12-07 18:06:41
问题 I have a source file. When I compile the code, I want the executable file to remember when it was built. I am wondering if it is possible. For example: int main(){ time_t t = ??? // Time when this line is compiled //print out value of t in certain format. return t } 回答1: You can use the __TIME__ and __DATE__ macros to get the time the preprocessor ran at. It's a string, so yo need to convert it to a time_t from there. A quick example I put together: #include <time.h> #include <iostream>