Showing posts with label compiler. Show all posts
Showing posts with label compiler. Show all posts
Wednesday, September 18, 2013
How kernel compiler c library work together
http://wiki.osdev.org/How_kernel,_compiler,_and_C_library_work_together
Labels:
C/C++,
compiler,
Kernel,
Linux,
OS,
Programming,
Software Engineering
Tuesday, August 20, 2013
Static Library .a and Dynamic Library .so
http://www.ilkda.com/compile/Static_Versus_Dynamic.htm
Creating .so and .a in Unix
http://stackoverflow.com/questions/1648215/creating-so-and-a-in-unix
Creating .so and .a in Unix
http://stackoverflow.com/questions/1648215/creating-so-and-a-in-unix
Tuesday, July 30, 2013
Difference between const & const volatile
An object marked as
const volatile will not be permitted to be changed by the code (an error will be raised due to the const qualifier) - at least through that particular name/pointer.
The
volatile part of the qualifier means that the compiler cannot optimize or reorder access to the object.
In an embedded system, this is typically used to access hardware registers that can be read and are updated by the hardware, but make no sense to write to (or might be an error to write to).
unsigned int const volatile *status_reg; // assume these are assigned to point to the
unsigned char const volatile *recv_reg; // correct hardware addresses
#define UART_CHAR_READY 0x00000001
int get_next_char()
{
while ((*status_reg & UART_CHAR_READY) == 0) {
// do nothing but spin
}
return *recv_reg;
}
If these pointers were not marked as being volatile, a couple problems might occur:
- the while loop test might read the status register only once, since the compiler could assume that whatever it pointed to would never change (there's nothing in the while loop test or loop itself that could change it). If you entered the function when there was no character waiting in UART hardware, you might end up in an infinite loop that never stopped even when a character was received.
- the read of the receive register could be moved by the compiler to before the while loop - again because there's nothing in the function that indicates that
*recv_reg is changed by the loop, there's no reason it can't be read before entering the loop.
The volatile qualifiers ensures that these optimizations are not performed by the compiler.
Friday, July 19, 2013
Tuesday, July 16, 2013
Error: Unterminated character constant beginning at (1)
http://gcc.gnu.org/ml/fortran/2007-12/msg00212.html
Error: Unterminated character constant beginning at (1)
aaa.f:4.72:
print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"
1
Warning: Line truncated at (1)
Fixed-form Fortran has only 72 characters per line. What happens with
longer lines is implementation dependent. However, many
programmers/programs assume that everything after column 72 is ignored
(which gfortran does).
Solution: Fix the program by splitting the line or by using the
-ffixed-line-length-n (n is a non-negative integer).
Tuesday, May 14, 2013
Tuesday, April 16, 2013
using valgrind to check memory leak
http://cs.ecs.baylor.edu/~donahoo/tools/valgrind/
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./test
Tuesday, April 9, 2013
unrecognized command line option “-std=c++11” with g++
http://stackoverflow.com/questions/14674597/cc1plus-error-unrecognized-command-line-option-std-c11-with-g
In versions pre-G++ 4.7, you'll have to use
http://stackoverflow.com/questions/11616539/g-nullptr-was-not-declared-in-this-scope
In versions pre-G++ 4.7, you'll have to use
-std=c++0x, for more recent versions you can use -std=c++11.http://stackoverflow.com/questions/11616539/g-nullptr-was-not-declared-in-this-scope
Wednesday, February 27, 2013
Tuesday, February 26, 2013
Sunday, October 28, 2012
Thursday, April 19, 2012
Wednesday, April 18, 2012
GPU: architecture and programming (NYU Course)
http://cs.nyu.edu/courses/spring12/CSCI-GA.3033-012/index.html
Contains some interesting links for GPU tools from webpage above
Multi2Sim Simulation Framework
http://www.multi2sim.org/
GPUocelot
http://code.google.com/p/gpuocelot/
Dynamic Compilation for PTX
Short CUDA tutorial of Colorado School of Mines
http://geco.mines.edu/tesla/cuda_tutorial_mio/index.html
Contains some interesting links for GPU tools from webpage above
Multi2Sim Simulation Framework
http://www.multi2sim.org/
GPUocelot
http://code.google.com/p/gpuocelot/
Dynamic Compilation for PTX
Short CUDA tutorial of Colorado School of Mines
http://geco.mines.edu/tesla/cuda_tutorial_mio/index.html
Labels:
compiler,
Compiler Optimization,
Courses,
CUDA,
GPU,
Programming
Subscribe to:
Posts (Atom)