gnu

building a Cygwin version of GNU make

拜拜、爱过 提交于 2019-12-07 16:29:28
问题 I want to add a couple of logging options to GNU make so I can see what is happening when building FireFox and friends. I have the make-3.80 sources and a complete working Cygwin build environment. Starting with ./configure and the Make I get a working executable as expected. Question: What configuration is required so the executable in an identical manner to the make.exe bundled in Moztools? Background: If HAVE_CYGWIN_SHELL is not defined then with #define HAVE_CYGWIN_SHELL 1 Make barfs as

How to make configure script check the dependencies

守給你的承諾、 提交于 2019-12-07 12:47:56
问题 I generated a configure script with autoconf to build my project. It works fine unless I don't have some needed library installed. Make returns error when lacking some files, but it should be actually checked by the configure script i think? So my question is: How to modify an autoconf generated script to seek for dependencies and tell the user which libraries it lacks? 回答1: Depends on the dependency, there is no generic solution. There are AC_CHECK_LIB and AC_SEARCH_LIBS macros that may work

Octave GNU: Undefined variable 'x' , even though it's defined as function input

 ̄綄美尐妖づ 提交于 2019-12-07 11:58:31
问题 just trying to write a simple program to find the gcd of n numbers. I have no clue how to fix this error, i've read all of octaves function documentation and tried to find questions like this ... Just started programming in Octave btw. Here's the code: function divisor = gcd(x, y) q=0; r=0; l=0; h=0; if(x>y) h=x; l=y; elseif(x<y) h=y; l=x; else h=y; l=x; endif while(r != 0) q=floor(h/l); r = h-l*q; q=h; r=l; endwhile divisor = q; printf("%d", q); return; endfunction The Error: error: 'x'

Linker input file unused c++ g++ make file

巧了我就是萌 提交于 2019-12-07 11:17:55
问题 I am unable to figure out what is causing this error that I keep getting upon making my project: i686-apple-darwin11-llvm-g++-4.2: -lncurses: linker input file unused because linking not done And my make file looks like this: CC = g++ LIB_FLAGS = -l ncurses FLAGS = $(LIB_FLAGS) DEPENDENCIES = window.o element.o # FINAL OUTPUTS main: main.cpp $(DEPENDENCIES) $(CC) $(FLAGS) -o main.out main.cpp $(DEPENDENCIES) # MODULES window.o: main.h classes/window.cpp $(CC) $(FLAGS) -c classes/window.cpp

GNU make kind-of-double colon

只谈情不闲聊 提交于 2019-12-07 09:59:28
问题 I've got a little problem understanding following gmake syntax: OBJ = foo.o bar.o $(OBJ): %.o: %.cpp $(CC) -c -MMD -MP $(INCLUDES) $(CFLAGS) $< -o $@ @sed (...create empty targets in file...) I'm not sure what $(...): %.o: %.cpp does!? I think it might translate the "%.o: %.cpp" in correct %.cpp dependencies - does it? Google is not much of a help here - it finds just the usual double colon (target::) which is something different! Any advice? Thanks! 回答1: This is a static pattern rule. $(OBJ)

Xcode warning: … is a GNU extension

半腔热情 提交于 2019-12-07 07:31:19
问题 I use a C++ library for an iOS app. With Apple LLVM 3.1 compiler configured (default), I get a lot of warnings for this C++ code, most of them saying: ... is a GNU extension The introduction of clang's user manual says: The Clang driver and language features are intentionally designed to be as compatible with the GNU GCC compiler as reasonably possible, easing migration from GCC to Clang. In most cases, code "just works". So, is it save to just look for a switch to disable this warnings (btw.

how to use the GNU hcreate_r

谁说胖子不能爱 提交于 2019-12-07 05:08:10
问题 #include <stdio.h> #include <stdlib.h> #include <search.h> #include <assert.h> char *data[] = { "alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whisky", "x-ray", "yankee", "zulu" }; int main(void) { ENTRY e, **ep; struct hsearch_data *htab; int i; int resultOfHcreate_r; resultOfHcreate_r=hcreate_r(30,htab); assert(resultOfHcreate_r!=0);

gnu parallel to parallelize a for loop

落爺英雄遲暮 提交于 2019-12-07 04:09:55
问题 I have seen several questions about this topic, but I lack the ability to translate this to my specific problem. I have a for loop that loops through sub directories and then executes a .sh script on a compressed text file inside each directory. I want to parallelize this process, but I'm struggling to apply gnu parallel. Here is my loop: for d in ./*/ ; do (cd "$d" && script.sh); done I understand I need to input a list into parallel, so i have been trying this: ls -d */ | parallel cd &&

configure: error: no acceptable C compiler found in $PATH

可紊 提交于 2019-12-07 02:38:35
问题 I am trying to Build and Install the Apache Thrift compiler and libraries I had to type this command is shown in instructions ./configure && make But I get this error: checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/PATH/TO/thrift-0.9.3': configure: error: no acceptable C compiler found in $PATH When I type in my command prompt gcc --version I get this gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the

Standard C++ libraries headers on gnu gcc site

前提是你 提交于 2019-12-07 02:13:25
I want to browse the source code of gnu implementation of C++ standard libraries -- header files as well as the implementation. I have landed myself into: http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/index.html My first step was to look header file at: http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/a01376.html My question is that as per my understanding the typedeffed string sth like: typedef basic_string string; should have been present in string header, but I don't see one here. Questions: --in which file is the definition of string symbol? --I see that