Programming attiny45 chip and ir remote library - arduino-uno

I'm using the IR Remote library with an attiny45 chip. The codes works fine with an Arduino but getting error message when uploading to attiny45 chip.
#include <IRremote.h>
int RECV_PIN = 2;
int led = 1;
int relay = 0;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
irrecv.enableIRIn(); // Start the receiver
pinMode (led, OUTPUT);
pinMode (relay, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
switch (results.value) {
case 0xff02fd :
digitalWrite(led, HIGH);
digitalWrite(relay, LOW);
break;
case 0x1FC42BD :
digitalWrite(led, HIGH);
digitalWrite(relay, LOW);
break;
default :
digitalWrite(led, LOW);
digitalWrite(relay, HIGH);
break;
}
irrecv.resume(); // Receive the next value
}
}
When uploading, i'm getting the following error messages :
Arduino: 1.8.1 (Windows 7), Board: "ATtiny25/45/85, ATtiny45, Internal 8 MHz"
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:176:3: error: 'TCCR2A' was not declared in this scope
TCCR2A |= _BV(COM2B1); // Enable pin 3 PWM output
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:176:17: error: 'COM2B1' was not declared in this scope
TCCR2A |= _BV(COM2B1); // Enable pin 3 PWM output
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:188:3: error: 'TCCR2A' was not declared in this scope
TCCR2A &= ~(_BV(COM2B1)); // Disable pin 3 PWM output
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:188:19: error: 'COM2B1' was not declared in this scope
TCCR2A &= ~(_BV(COM2B1)); // Disable pin 3 PWM output
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:210:3: error: 'TIMSK2' was not declared in this scope
TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:210:18: error: 'TOIE2' was not declared in this scope
TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:228:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = _BV(WGM20);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:228:16: error: 'WGM20' was not declared in this scope
TCCR2A = _BV(WGM20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:3: error: 'TCCR2B' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:16: error: 'WGM22' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:29: error: 'CS20' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:232:3: error: 'OCR2A' was not declared in this scope
OCR2A = SYSCLOCK / 2 / khz / 1000;
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:233:3: error: 'OCR2B' was not declared in this scope
OCR2B = OCR2A / 3; // 33% duty cycle
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:262:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = 0; // normal mode
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:7: error: 'TCCR2B' was not declared in this scope
cbi(TCCR2B,CS22);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS22);
^
Multiple libraries were found for "IRremote.h"
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:14: error: 'CS22' was not declared in this scope
Used: C:\Users\Acer\Documents\Arduino\libraries\IRremote
cbi(TCCR2B,CS22);
Not used: C:\Users\Acer\Documents\Arduino\libraries\IRremote1
^
Not used: C:\Users\Acer\Documents\Arduino\libraries\Arduino-IRremote-master
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS22);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:268:14: error: 'CS21' was not declared in this scope
sbi(TCCR2B,CS21);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:268:3: note: in expansion of macro 'sbi'
sbi(TCCR2B,CS21);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:269:14: error: 'CS20' was not declared in this scope
cbi(TCCR2B,CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:269:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:7: error: 'TIMSK2' was not declared in this scope
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:3: note: in expansion of macro 'sbi'
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:14: error: 'TOIE2' was not declared in this scope
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:3: note: in expansion of macro 'sbi'
sbi(TIMSK2,TOIE2);
^
In file included from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:0:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:46:24: error: 'TCNT2' was not declared in this scope
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT2
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:278:3: note: in expansion of macro 'RESET_TIMER2'
RESET_TIMER2;
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In function 'void __vector_5()':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:46:24: error: 'TCNT2' was not declared in this scope
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT2
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:308:3: note: in expansion of macro 'RESET_TIMER2'
RESET_TIMER2;
^
exit status 1
Error compiling for board ATtiny25/45/85.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
This is the version of Arduino that i'm using :
Arduino: 1.8.1 (Windows 7), Board: "ATtiny25/45/85, ATtiny45, Internal 8 MHz"

I am pretty sure this has problem has to be the fact when downloading to an attiny45 or any Arduino-like-chip you need to reset the chip as code is being downloaded. The reset pin is pin 1. To reset it you should ground the pin. Here is the pinout diagram for reference.

Related

error: "Protobuf requires at least C++11." with clang version already on version 13.1

I am using mac M1 chip.
i am doing bundle install to install the dependency of my service.
One of our ruby package is using protobuf, so i am getting below error while installing package natively.
Clang version installed is already 13+.
My ruby version is 2.6.6.
i tried with clang version below 11, but getting same error.
Anyone can help what is going wrong here?
/opt/homebrew/include/google/protobuf/stubs/port.h:123:2: error: "Protobuf requires at least C++11."
#error "Protobuf requires at least C++11."
^
/opt/homebrew/include/google/protobuf/stubs/port.h:129:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using ConstStringParam = const std::string &;
^
/opt/homebrew/include/google/protobuf/stubs/port.h:145:39: error: expected '(' for function-style cast or type construction
static const int64 kint64max = int64_t{0x7FFFFFFFFFFFFFFF};
~~~~~~~^
/opt/homebrew/include/google/protobuf/stubs/port.h:148:42: error: expected '(' for function-style cast or type construction
static const uint64 kuint64max = uint64_t{0xFFFFFFFFFFFFFFFFu};
~~~~~~~~^
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/src/one_quota.cpp:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/include/one_quota.h:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:9:
In file included from /opt/homebrew/include/google/protobuf/stubs/common.h:49:
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:165:23: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using traits_type = std::char_traits<char>;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:166:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using value_type = char;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:167:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using pointer = char*;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:168:25: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using const_pointer = const char*;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:169:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using reference = char&;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:170:27: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using const_reference = const char&;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:171:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using const_iterator = const char*;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:172:20: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using iterator = const_iterator;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:173:34: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:174:28: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using reverse_iterator = const_reverse_iterator;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:175:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using size_type = size_t;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:176:27: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using difference_type = std::ptrdiff_t;
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:182:10: error: unknown type name 'constexpr'
static constexpr size_type kMaxSize =
^
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:182:29: error: expected ';' at end of declaration list
static constexpr size_type kMaxSize =
^
;
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:280:3: warning: explicit conversion functions are a C++11 extension [-Wc++11-extensions]
explicit operator std::string() const { return ToString(); }
^~~~~~~~
/opt/homebrew/include/google/protobuf/stubs/stringpiece.h:187:39: error: use of undeclared identifier 'kMaxSize'
if (PROTOBUF_PREDICT_FALSE(size > kMaxSize)) {
^
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/src/one_quota.cpp:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/include/one_quota.h:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:9:
/opt/homebrew/include/google/protobuf/stubs/common.h:166:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto volatile unused = &var;
^
/opt/homebrew/include/google/protobuf/stubs/common.h:179:36: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
const char* what() const throw() override;
^
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/src/one_quota.cpp:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/include/one_quota.h:1:
/Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:17:2: error: This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:19:2: error: regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/src/one_quota.cpp:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/include/one_quota.h:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:22:
In file included from /opt/homebrew/include/google/protobuf/generated_message_util.h:49:
In file included from /opt/homebrew/include/google/protobuf/any.h:37:
In file included from /opt/homebrew/include/google/protobuf/arenastring.h:38:
In file included from /opt/homebrew/include/google/protobuf/stubs/logging.h:36:
/opt/homebrew/include/google/protobuf/stubs/status.h:46:6: warning: scoped enumerations are a C++11 extension [-Wc++11-extensions]
enum class StatusCode : int {
^
/opt/homebrew/include/google/protobuf/stubs/status.h:81:43: warning: use of enumeration in a nested name specifier is a C++11 extension [-Wc++11-extensions]
bool ok() const { return error_code_ == StatusCode::kOk; }
^
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/src/one_quota.cpp:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/include/one_quota.h:1:
In file included from /Users/<username>.rvm/gems/ruby-2.6.6/gems/pipeline-3.2/ext/protobuf/protobuf/Consumer.pb.h:22:
In file included from /opt/homebrew/include/google/protobuf/generated_message_util.h:49:
In file included from /opt/homebrew/include/google/protobuf/any.h:37:
In file included from /opt/homebrew/include/google/protobuf/arenastring.h:40:
In file included from /opt/homebrew/include/google/protobuf/arena.h:55:
/opt/homebrew/include/google/protobuf/arena_impl.h:54:8: error: unknown type name 'constexpr'
inline constexpr size_t AlignUpTo8(size_t n) {
^
/opt/homebrew/include/google/protobuf/arena_impl.h:54:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
inline constexpr size_t AlignUpTo8(size_t n) {
^
/opt/homebrew/include/google/protobuf/arena_impl.h:54:24: error: expected ';' after top level declarator
inline constexpr size_t AlignUpTo8(size_t n) {
^
;
/opt/homebrew/include/google/protobuf/arena_impl.h:90:30: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
~ArenaMetricsCollector() = default;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:95:10: error: unknown type name 'constexpr'
static constexpr size_t kDefaultStartBlockSize = 256;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:95:26: error: expected ';' at end of declaration list
static constexpr size_t kDefaultStartBlockSize = 256;
^
;
/opt/homebrew/include/google/protobuf/arena_impl.h:96:10: error: unknown type name 'constexpr'
static constexpr size_t kDefaultMaxBlockSize = 8192;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:96:26: error: expected ';' at end of declaration list
static constexpr size_t kDefaultMaxBlockSize = 8192;
^
;
/opt/homebrew/include/google/protobuf/arena_impl.h:98:3: error: unknown type name 'size_t'
size_t start_block_size = kDefaultStartBlockSize;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:98:27: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
size_t start_block_size = kDefaultStartBlockSize;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:99:3: error: unknown type name 'size_t'
size_t max_block_size = kDefaultMaxBlockSize;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:99:25: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
size_t max_block_size = kDefaultMaxBlockSize;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:100:24: error: unknown type name 'size_t'
void* (*block_alloc)(size_t) = nullptr;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:100:32: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
void* (*block_alloc)(size_t) = nullptr;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:101:32: error: unknown type name 'size_t'
void (*block_dealloc)(void*, size_t) = nullptr;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:101:40: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
void (*block_dealloc)(void*, size_t) = nullptr;
^
/opt/homebrew/include/google/protobuf/arena_impl.h:102:44: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
ArenaMetricsCollector* metrics_collector = nullptr;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
25 warnings and 20 errors generated.
make[2]: *** [src/CMakeFiles/Protobuf.dir/one_quota.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/Protobuf.dir/all] Error 2
make: *** [all] Error 2

Errors while Installing Garfield++

Apologies beforehand, I figure this is the kind of thing that probably has been posted about before but I couldn't find anything when I searched.
I'm trying to install Garfield++ and getting some error messages when I try to run the cmake. My system is running Ubuntu 18.04.5 LTS and ROOT version 6.20/02.
Everything seems to go fine until I try make -j N
When that happens I get these errors.
[ 0%] Generating GarfieldDict.cxx, libGarfieldDict_rdict.pcm, libGarfieldDict.rootmap
In file included from input_line_6:3:
In file included from /home/jason/Root/build/include/TObject.h:18:
/home/jason/Root/build/include/TStorage.h:93:4: error: use of undeclared identifier 'R__likely'
ClassDef(TStorage,0) //Storage manager class
^
/home/jason/Root/build/include/Rtypes.h:327:4: note: expanded from macro 'ClassDef'
_ClassDefOutline_(name,id,virtual,) \
^
/home/jason/Root/build/include/Rtypes.h:301:4: note: expanded from macro '_ClassDefOutline_'
_ClassDefBase_(name,id, virtual_keyword, overrd) \
^
/home/jason/Root/build/include/Rtypes.h:276:11: note: expanded from macro '_ClassDefBase_'
if (R__likely(recurseBlocker >= 2)) ...
^
In file included from input_line_6:3:
In file included from /home/jason/Root/build/include/TObject.h:18:
/home/jason/Root/build/include/TStorage.h:93:13: error: 'TStorage' does not refer to a value
ClassDef(TStorage,0) //Storage manager class
^
/home/jason/Root/build/include/TStorage.h:33:7: note: declared here
class TStorage {
^
/home/jason/Root/build/include/TStorage.h:118:1: error: use of undeclared identifier 'R__INTENTIONALLY_UNINIT_BEGIN'
R__INTENTIONALLY_UNINIT_BEGIN
^
/home/jason/Root/build/include/TStorage.h:120:1: error: use of undeclared identifier 'R__INTENTIONALLY_UNINIT_END'
R__INTENTIONALLY_UNINIT_END
^
/home/jason/Root/build/include/TStorage.h:131:1: error: unknown type name 'R__NEVER_INLINE'
R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uni...
^
/home/jason/Root/build/include/TStorage.h:131:17: error: expected unqualified-id
R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uni...
^
In file included from input_line_6:3:
/home/jason/Root/build/include/TObject.h:133:4: error: unknown type name 'R__ALWAYS_INLINE'
R__ALWAYS_INLINE Bool_t IsOnHeap() const { return TestBit(kIsOnHeap); }
^
/home/jason/Root/build/include/TObject.h:133:27: error: expected ';' at end of declaration list
R__ALWAYS_INLINE Bool_t IsOnHeap() const { return TestBit(kIsOnHeap); }
^
;
/home/jason/Root/build/include/TObject.h:169:30: error: unknown type name 'Bool_t'
void SetBit(UInt_t f, Bool_t set);
^
/home/jason/Root/build/include/TObject.h:172:4: error: unknown type name 'R__ALWAYS_INLINE'
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const { return (Bool_t) ((f...
^
/home/jason/Root/build/include/TObject.h:172:21: error: duplicate member 'Bool_t'
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const { return (Bool_t) ((f...
^
/home/jason/Root/build/include/TObject.h:133:21: note: previous declaration is here
R__ALWAYS_INLINE Bool_t IsOnHeap() const { return TestBit(kIsOnHeap); }
^
/home/jason/Root/build/include/TObject.h:172:27: error: expected ';' at end of declaration list
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const { return (Bool_t) ((f...
^
;
/home/jason/Root/build/include/TObject.h:210:11: error: unknown type name 'Bool_t'
static Bool_t GetObjectStat();
^
/home/jason/Root/build/include/TObject.h:211:35: error: unknown type name 'Bool_t'
static void SetObjectStat(Bool_t stat);
^
/home/jason/Root/build/include/TObject.h:215:4: error: unknown type name 'Bool_t'
ClassDef(TObject,1) //Basic ROOT object
^
/home/jason/Root/build/include/Rtypes.h:327:4: note: expanded from macro 'ClassDef'
_ClassDefOutline_(name,id,virtual,) \
^
/home/jason/Root/build/include/Rtypes.h:301:4: note: expanded from macro '_ClassDefOutline_'
_ClassDefBase_(name,id, virtual_keyword, overrd) \
^
/home/jason/Root/build/include/Rtypes.h:273:20: note: expanded from macro '_ClassDefBase_'
virtual_keyword Bool_t CheckTObjectHashConsistency() const overr...
^
In file included from input_line_6:3:
/home/jason/Root/build/include/TObject.h:215:4: error: use of undeclared identifier 'R__likely'
/home/jason/Root/build/include/Rtypes.h:327:4: note: expanded from macro 'ClassDef'
_ClassDefOutline_(name,id,virtual,) \
^
/home/jason/Root/build/include/Rtypes.h:301:4: note: expanded from macro '_ClassDefOutline_'
_ClassDefBase_(name,id, virtual_keyword, overrd) \
^
/home/jason/Root/build/include/Rtypes.h:276:11: note: expanded from macro '_ClassDefBase_'
if (R__likely(recurseBlocker >= 2)) ...
^
In file included from input_line_6:3:
/home/jason/Root/build/include/TObject.h:215:13: error: 'TObject' does not refer to a value
ClassDef(TObject,1) //Basic ROOT object
^
/home/jason/Root/build/include/TObject.h:37:7: note: declared here
class TObject {
^
/home/jason/Root/build/include/TObject.h:237:8: error: use of undeclared identifier 'R__unlikely'
if (R__unlikely(fgObjectStat)) TObject::AddToTObjectTable(this);
^
/home/jason/Root/build/include/TObject.h:261:8: error: use of undeclared identifier 'R__unlikely'
if (R__unlikely(fgObjectStat)) TObject::AddToTObjectTable(this);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Error: Error loading the default header files.
CMakeFiles/Garfield.dir/build.make:208: recipe for target 'GarfieldDict.cxx' failed
make[2]: *** [GarfieldDict.cxx] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Garfield.dir/all' failed
make[1]: *** [CMakeFiles/Garfield.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
To be frank, I have only a vague idea what this means. I think it means that the Garfield++ cmake can find my ROOT but for some reason can't read it properly, which I don't know how to fix.
Any help would be appreciated.
I followed the instructions at https://garfieldpp.web.cern.ch/garfieldpp/getting-started/
Phase 1 --
The only deviation from the link was having to tell ccmake where my root directory was. 1st Phase - Checked Prerequisites: A C++ compiler that could support C++11, Root (at least version 6), GSL (GNU Scientific Library), and CMake (at least version 3.3). Only lacked GSL so I went to http://mirrors.ibiblio.org/gnu/ftp/gnu/gsl and, downloaded and installed version 2.6.
Phase 2
mkdir GARFIELD
export GARFIELD_HOME=/home/GARFIELD
git clone http://gitlab.cern.ch/garfield/garfieldpp.git $GARFIELD_HOME
cd $GARFIELD_HOME
mkdir build
cd build
cmake $GARFIELD_HOME
make -j 4
The last step which has the failure. [Though I have noticed that the second to last step, while it runs, does leave a field blank. So here's the results of cmake $GARFIELD_HOME.
-- -----------------------------------------------------------
-- Garfield source files: Source/AvalancheMC.cc;Source/AvalancheMicroscopic.cc;Source/Component.cc;Source/ComponentAnalyticField.cc;Source/ComponentAnsys121.cc;Source/ComponentAnsys123.cc;Source/ComponentCST.cc;Source/ComponentComsol.cc;Source/ComponentConstant.cc;Source/ComponentElmer.cc;Source/ComponentElmer2D.cc;Source/ComponentFieldMap.cc;Source/ComponentGrid.cc;Source/ComponentNeBem2d.cc;Source/ComponentNeBem3d.cc;Source/ComponentNeBem3dMap.cc;Source/ComponentTcad2d.cc;Source/ComponentTcad3d.cc;Source/ComponentUser.cc;Source/ComponentVoxel.cc;Source/DriftLineRKF.cc;Source/GeometryRoot.cc;Source/GeometrySimple.cc;Source/KDTree.cc;Source/Medium.cc;Source/MediumCdTe.cc;Source/MediumGaAs.cc;Source/MediumGas.cc;Source/MediumMagboltz.cc;Source/MediumSilicon.cc;Source/Numerics.cc;Source/OpticalData.cc;Source/PlottingEngineRoot.cc;Source/Polygon.cc;Source/Random.cc;Source/RandomEngineRoot.cc;Source/Sensor.cc;Source/Shaper.cc;Source/Solid.cc;Source/SolidBox.cc;Source/SolidExtrusion.cc;Source/SolidHole.cc;Source/SolidRidge.cc;Source/SolidSphere.cc;Source/SolidTube.cc;Source/SolidWire.cc;Source/TetrahedralTree.cc;Source/Track.cc;Source/TrackBichsel.cc;Source/TrackElectron.cc;Source/TrackHeed.cc;Source/TrackPAI.cc;Source/TrackSimple.cc;Source/TrackSrim.cc;Source/ViewBase.cc;Source/ViewCell.cc;Source/ViewDrift.cc;Source/ViewFEMesh.cc;Source/ViewField.cc;Source/ViewGeometry.cc;Source/ViewIsochrons.cc;Source/ViewMedium.cc;Source/ViewSignal.cc;GarfieldDict.cxx
-- -----------------------------------------------------------
-- Heed source files: Heed/HeedFieldMap.cpp;Heed/heed++/code/BGMesh.cpp;Heed/heed++/code/ElElasticScat.cpp;Heed/heed++/code/EnTransfCS.cpp;Heed/heed++/code/EnTransfCS_BGM.cpp;Heed/heed++/code/EnergyMesh.cpp;Heed/heed++/code/HeedCluster.cpp;Heed/heed++/code/HeedCondElectron.cpp;Heed/heed++/code/HeedDeltaElectron.cpp;Heed/heed++/code/HeedDeltaElectronCS.cpp;Heed/heed++/code/HeedMatterDef.cpp;Heed/heed++/code/HeedParticle.cpp;Heed/heed++/code/HeedParticle_BGM.cpp;Heed/heed++/code/HeedPhoton.cpp;Heed/heed++/code/PairProd.cpp;Heed/heed++/code/PhotoAbsCS.cpp;Heed/heed++/code/PhotoAbsCSLib.cpp;;Heed/wcpplib/geometry/box.cpp;Heed/wcpplib/geometry/circumf.cpp;Heed/wcpplib/geometry/gparticle.cpp;Heed/wcpplib/geometry/mparticle.cpp;Heed/wcpplib/geometry/plane.cpp;Heed/wcpplib/geometry/polyline.cpp;Heed/wcpplib/geometry/straight.cpp;Heed/wcpplib/geometry/surface.cpp;Heed/wcpplib/geometry/trajestep.cpp;Heed/wcpplib/geometry/vec.cpp;Heed/wcpplib/geometry/volume.cpp;Heed/wcpplib/ioniz/bethe_bloch.cpp;Heed/wcpplib/ioniz/e_cont_enloss.cpp;Heed/wcpplib/math/DoubleAc.cpp;Heed/wcpplib/math/PolLeg.cpp;Heed/wcpplib/math/cubic.cpp;Heed/wcpplib/math/kinem.cpp;Heed/wcpplib/math/linexi2.cpp;Heed/wcpplib/math/lorgamma.cpp;Heed/wcpplib/math/parabola.cpp;Heed/wcpplib/matrix/inverse.cpp;Heed/wcpplib/matrix/multiply.cpp;Heed/wcpplib/matter/AtomDef.cpp;Heed/wcpplib/matter/GasDef.cpp;Heed/wcpplib/matter/GasLib.cpp;Heed/wcpplib/matter/MatterDef.cpp;Heed/wcpplib/matter/MoleculeDef.cpp;Heed/wcpplib/particle/eparticle.cpp;Heed/wcpplib/particle/particle_def.cpp;Heed/wcpplib/random/PointsRan.cpp;Heed/wcpplib/random/chisran.cpp;Heed/wcpplib/random/pois.cpp;Heed/wcpplib/random/rnorm.cpp;Heed/wcpplib/safetl/AbsArr.cpp;Heed/wcpplib/safetl/AbsPtr.cpp;Heed/wcpplib/stream/definp.cpp;Heed/wcpplib/stream/findmark.cpp;Heed/wcpplib/stream/prstream.cpp;Heed/wcpplib/util/FunNameStack.cpp
-- -----------------------------------------------------------
-- Magboltz source files: Source/magboltz-11.9.f
-- -----------------------------------------------------------
-- neBEM source files: NeBem/ComputeProperties.c;NeBem/GarfieldppInterface.cpp;NeBem/Isles.c;NeBem/ReTriM.c;NeBem/Vector.c;NeBem/luc.c;NeBem/neBEM.c;NeBem/neBEMInterface.c;NeBem/nrutil.c;NeBem/svdcmp.c
-- -----------------------------------------------------------
-- Directory used to find ROOT dict files:
-- -----------------------------------------------------------
-- Garfield++ examples will be built. In order disable this option use -DWITH_EXAMPLES=OFF
-- Install path: /usr/local
-- If you want to change this path call cmake -DCMAKE_INSTALL_PREFIX=my_install_path ...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jason/GARFIELD/build
Notice the Root directory line is blank. How do I fix that?
Edit:2-
Measured success. Switched the location where ROOT is read from to where it was installed instead of where it was built and I got a new error message.
[ 0%] Generating GarfieldDict.cxx, libGarfieldDict_rdict.pcm, libGarfieldDict.rootmap
No such file or directory
CMakeFiles/Garfield.dir/build.make:208: recipe for target 'GarfieldDict.cxx' failed
make[2]: *** [GarfieldDict.cxx] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Garfield.dir/all' failed
make[1]: *** [CMakeFiles/Garfield.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Still emotionally processing the full implications.

implicit declaration of function 'ipipe_restore_pipeline_head'; did you mean did you mean 'ipipe_test_thread_flag'

I'm trying to build an embedded OS with buildroot 2020.02 with 2 kernel. My Linux kernel is 4.19.107 and my Xenomai kernel is 3.1. I apply the Adeos patch in order to have the ipipe fetatures : ipipe-core-4.19.106-cip21-arm07 from this site : https://xenomai.org/downloads/ipipe/v4.x/arm/.
The compilation work with an old kernel and an old xenomai version , but with this one I have compilation errors in /include/asm-generic/xenomai/hal.h and hal.c :
./include/asm-generic/xenomai/hal.h:169:34: error: implicit declaration of function 'ipipe_propagate_irq'; did you mean 'rthal_propagate_irq'? [-Werror=implicit-function-declaration]
#define rthal_propagate_irq(irq) ipipe_propagate_irq(irq)
^~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:524:2: note: in expansion of macro 'rthal_propagate_irq'
rthal_propagate_irq(irq);
^~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h: In function '__rthal_apc_schedule':
./include/asm-generic/xenomai/hal.h:168:38: error: implicit declaration of function 'ipipe_schedule_irq'; did you mean 'ipipe_disable_irq'? [-Werror=implicit-function-declaration]
#define rthal_schedule_irq_root(irq) ipipe_schedule_irq(irq)
^~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:537:3: note: in expansion of macro 'rthal_schedule_irq_root'
rthal_schedule_irq_root(rthal_apc_virq);
^~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h: In function 'rthal_apc_schedule':
./include/asm-generic/xenomai/hal.h:118:41: error: implicit declaration of function 'ipipe_test_and_stall_pipeline_head'; did you mean 'ipipe_test_and_stall_head'? [-Werror=implicit-function-declaration]
#define rthal_local_irq_save(x) ((x) = ipipe_test_and_stall_pipeline_head() & 1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:118:41: note: in definition of macro 'rthal_local_irq_save'
#define rthal_local_irq_save(x) ((x) = ipipe_test_and_stall_pipeline_head() & 1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:119:36: error: implicit declaration of function 'ipipe_restore_pipeline_head'; did you mean 'ipipe_restore_head'? [-Werror=implicit-function-declaration]
#define rthal_local_irq_restore(x) ipipe_restore_pipeline_head(x)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:546:2: note: in expansion of macro 'rthal_local_irq_restore'
rthal_local_irq_restore(flags);
^~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:203:3: error: implicit declaration of function 'ipipe_stall_pipeline_from'; did you mean 'ipipe_stall_head'? [-Werror=implicit-function-declaration]
ipipe_stall_pipeline_from(ipipe_root_domain); \
^~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/system.h:159:3: note: in expansion of macro 'rthal_emergency_console'
rthal_emergency_console();
^~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/xenomai/hal.h:204:3: error: implicit declaration of function 'ipipe_set_printk_sync'; did you mean 'ipipe_set_hooks'? [-Werror=implicit-function-declaration]
ipipe_set_printk_sync(ipipe_current_domain); \
^~~~~~~~~~~~~~~~~~~~~
I search in the ipipe.h file but unfortunately none of those methods are defined here and I don't find the equivalent.
Does anyone knows if there is an issue ?
Foundly

Clang and Linux kernel

I try to make AST file for Linux kernel 2.6.37 code with clang 8.0.0.
I run following in kernel root directory
clang -emit-ast init/main.c -o astfile -std=c11 -Iinclude -Iarch/x86/include
and get errors
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:12:
/mnt/lfs/sources/linux-2.6.37/include/linux/types.h:13:2: warning: "Attempt to use kernel
headers from user space, see http://kernelnewbies.org/KernelHeaders" [-W#warnings]
#warning "Attempt to use kernel headers from user space, see http://kernelnewbies...
^
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:13:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/module.h:9:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/list.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/prefetch.h:14:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/processor.h:15:
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/current.h:12:8: error: unknown type
name '__always_inline'
static __always_inline struct task_struct *get_current(void)
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/current.h:12:24: error: expected
identifier or '('
static __always_inline struct task_struct *get_current(void)
^
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:13:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/module.h:9:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/list.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/prefetch.h:14:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/processor.h:17:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/system.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/cmpxchg.h:4:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/cmpxchg_64.h:4:
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:47:2: error: unknown
type name 'u8'
u8 *instr; /* original instruction */
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:48:2: error: unknown
type name 'u8'
u8 *replacement;
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:49:2: error: unknown
type name 'u16'
u16 cpuid; /* cpuid bit set for replacement */
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:50:2: error: unknown
type name 'u8'
u8 instrlen; /* length of original instruction */
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:51:2: error: unknown
type name 'u8'
u8 replacementlen; /* length of new instruction, <= instrlen */
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:164:62: error: unknown
type name 'size_t'
extern void *text_poke_early(void *addr, const void *opcode, size_t len);
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:183:56: error: unknown
type name 'size_t'
extern void *text_poke(void *addr, const void *opcode, size_t len);
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/alternative.h:184:60: error: unknown
type name 'size_t'
extern void *text_poke_smp(void *addr, const void *opcode, size_t len);
^
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:13:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/module.h:9:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/list.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/prefetch.h:14:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/processor.h:17:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/system.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/cmpxchg.h:4:
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/cmpxchg_64.h:6:39: error: unknown type
name 'u64'
static inline void set_64bit(volatile u64 *ptr, u64 val)
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/cmpxchg_64.h:6:49: error: unknown type
name 'u64'
static inline void set_64bit(volatile u64 *ptr, u64 val)
^
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:13:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/module.h:9:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/list.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/prefetch.h:14:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/processor.h:17:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/system.h:11:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/irqflags.h:15:
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:20:2: error: use of
undeclared identifier 'asm'
asm volatile("# __raw_save_flags\n\t"
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:31:2: error: use of
undeclared identifier 'asm'
asm volatile("push %0 ; popf"
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:39:2: error: use of
undeclared identifier 'asm'
asm volatile("cli": : :"memory");
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:44:2: error: use of
undeclared identifier 'asm'
asm volatile("sti": : :"memory");
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:49:2: error: use of
undeclared identifier 'asm'
asm volatile("sti; hlt": : :"memory");
^
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/irqflags.h:54:2: error: use of
undeclared identifier 'asm'
asm volatile("hlt": : :"memory");
^
In file included from /mnt/lfs/sources/linux-2.6.37/init/main.c:13:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/module.h:9:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/list.h:7:
In file included from /mnt/lfs/sources/linux-2.6.37/include/linux/prefetch.h:14:
In file included from /mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/processor.h:17:
/mnt/lfs/sources/linux-2.6.37/arch/x86/include/asm/system.h:335:2: error: use of
undeclared identifier 'asm'
asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p));
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
Please help, I have tried to google about this errors, but found nothing appropriate. I have added kernel header from kernel source directory with -I flag, because compiler could not find them on my system ArchLinux 5.0.10-arch1-1-ARCH.
Finally I've done this with help of Kamil Cuk. I've used my .config file which have been generated for compilation during kernel configuration. I've opened it in Vim, removed #-lines and =y, added #define in the beginning of each line and saved as config.h in kernel root directory.
clang -emit-ast init/main.c -o astfile -I include -I arch/x86/include -D __EXPORTED_HEADERS__ -D __KERNEL__ -include config.h

EGlib 2.6.20 does not install (trying to install SCIP)

I am trying to solve an integer linear program using SCIP. The beta version that I require (for exact solving) is given at:
http://scip.zib.de/#exact
As linked there, the source code is at:
http://scip.zib.de/download.php?fname=scip-3.0.0-ex.tgz
I followed the INSTALL file. It requires the installation of EGlib 2.6.20. However, this installation fails during 'make' with the following error:
phani#OptiPlex-9030-AIO ~/EGlib-2.6.20 $ make
make[1]: Entering directory '/home/phani/EGlib-2.6.20'
make[1]: Leaving directory '/home/phani/EGlib-2.6.20'
make[1]: Entering directory '/home/phani/EGlib-2.6.20'
Building include/EGlib.h
Compiling src/eg_bit.c
Compiling src/eg_compare.c
Compiling src/eg_io.c
src/eg_io.c: In function ‘EGioGets’:
src/eg_io.c:618:7: warning: unused variable ‘b’ [-Wunused-variable]
char*b = buf;
^
src/eg_io.c: In function ‘EGioEof’:
src/eg_io.c:648:6: warning: unused variable ‘err’ [-Wunused-variable]
int err;
^
src/eg_io.c: In function ‘EGmvar’:
src/eg_io.c:42:2: warning: second parameter of ‘va_start’ not last named argument [-Wvarargs]
va_start (largs, nind);
^
Compiling src/eg_lpnum.c
Compiling src/eg_net.c
Compiling src/eg_random.c
Compiling src/eg_macros.c
Compiling src/eg_ehash.c
Compiling src/eg_perm_it.c
Compiling src/eg_symtab.c
Compiling src/eg_keytab.c
Compiling src/eg_simula.c
In file included from src/eg_simula.c:25:0:
src/eg_simula.h:227:2: error: unknown type name ‘dbl_EGeHeapCn_t’
dbl_EGeHeapCn_t heap_cn;/**< connector in the heap containing the agent */
^
src/eg_simula.h:240:2: error: unknown type name ‘dbl_EGeHeap_t’
dbl_EGeHeap_t hp; /**< Heap containing events to be processed */
^
src/eg_simula.c: In function ‘EGsimExp’:
src/eg_simula.c:29:30: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimExp(const double t, void*const data)
^
src/eg_simula.c: In function ‘EGsimUniform’:
src/eg_simula.c:40:34: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimUniform(const double t, void*const data)
^
src/eg_simula.c: In function ‘EGsimNormal’:
src/eg_simula.c:51:33: warning: unused parameter ‘t’ [-Wunused-parameter]
double EGsimNormal(const double t, void*const data)
^
In file included from src/eg_simula.c:25:0:
src/eg_simula.c: In function ‘EGsimNewEvent’:
src/eg_simula.h:277:2: warning: implicit declaration of function ‘dbl_EGeHeapCnInit’ [-Wimplicit-function-declaration]
dbl_EGeHeapCnInit(&(__EGsimA->heap_cn));\
^
src/eg_simula.c:73:2: note: in expansion of macro ‘EGsimSetAgent’
EGsimSetAgent(la,sim->cur_time + gen->gen(sim->cur_time,gen->data));
^
src/eg_simula.c:74:13: error: request for member ‘val’ in something not a structure or union
la->heap_cn.val = la->last_time;
^
src/eg_simula.c:77:12: error: request for member ‘sz’ in something not a structure or union
if(sim->hp.sz == sim->hp.max_sz)
^
src/eg_simula.c:77:26: error: request for member ‘max_sz’ in something not a structure or union
if(sim->hp.sz == sim->hp.max_sz)
^
src/eg_simula.c:78:3: warning: implicit declaration of function ‘dbl_EGeHeapResize’ [-Wimplicit-function-declaration]
dbl_EGeHeapResize(&(sim->hp),sim->hp.sz*2);
^
src/eg_simula.c:78:39: error: request for member ‘sz’ in something not a structure or union
dbl_EGeHeapResize(&(sim->hp),sim->hp.sz*2);
^
src/eg_simula.c:80:9: warning: implicit declaration of function ‘dbl_EGeHeapAdd’ [-Wimplicit-function-declaration]
rval = dbl_EGeHeapAdd(&(sim->hp),&(la->heap_cn));
^
In file included from src/eg_simula.h:47:0,
from src/eg_simula.c:25:
src/eg_simula.c:85:55: error: request for member ‘val’ in something not a structure or union
MESSAGE(EG_SIM_VERBOSE,"new Agent at %lf",la->heap_cn.val);
^
src/eg_macros.h:246:18: note: in definition of macro ‘MESSAGE’
fprintf(stderr,__VA_ARGS__);\
^
In file included from src/eg_simula.h:47:0,
from src/eg_simula.c:25:
src/eg_simula.c: In function ‘EGsim’:
src/eg_simula.c:284:22: warning: implicit declaration of function ‘dbl_EGeHeapGetMin’ [-Wimplicit-function-declaration]
ca = EGcontainerOf(dbl_EGeHeapGetMin(&(sim->hp)), EGsimAgent_t,heap_cn);
^
src/eg_macros.h:134:56: note: in definition of macro ‘EGcontainerOf’
typeof(((__type *)0)->__member) *const __EGcOf_ptr = (__ptr);\
^
src/eg_macros.h:134:55: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
typeof(((__type *)0)->__member) *const __EGcOf_ptr = (__ptr);\
^
src/eg_simula.c:284:8: note: in expansion of macro ‘EGcontainerOf’
ca = EGcontainerOf(dbl_EGeHeapGetMin(&(sim->hp)), EGsimAgent_t,heap_cn);
^
src/eg_simula.c:285:30: error: request for member ‘val’ in something not a structure or union
sim->cur_time = ca->heap_cn.val;
^
src/eg_simula.c:327:17: error: request for member ‘val’ in something not a structure or union
na->heap_cn.val = sim->cur_time + cn->gen(sim->cur_time,cn->data);
^
src/eg_simula.c:328:6: warning: implicit declaration of function ‘dbl_EGeHeapSiftUp’ [-Wimplicit-function-declaration]
dbl_EGeHeapSiftUp(&(sim->hp),&(na->heap_cn));
^
src/eg_simula.c:365:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time;
^
src/eg_simula.c:371:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time + nn->gen(sim->cur_time,nn->data);
^
src/eg_simula.c:377:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = DBL_MAX;
^
src/eg_simula.c:381:12: warning: implicit declaration of function ‘dbl_EGeHeapSiftDown’ [-Wimplicit-function-declaration]
rval = dbl_EGeHeapSiftDown(&(sim->hp),&(ca->heap_cn));
^
src/eg_simula.c:388:5: warning: implicit declaration of function ‘dbl_EGeHeapDel’ [-Wimplicit-function-declaration]
dbl_EGeHeapDel(&(sim->hp),&(ca->heap_cn));
^
src/eg_simula.c:429:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time;
^
src/eg_simula.c:433:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = sim->cur_time + nn->gen(sim->cur_time,nn->data);
^
src/eg_simula.c:441:17: error: request for member ‘val’ in something not a structure or union
ca->heap_cn.val = DBL_MAX;
^
Makefile.library:38: recipe for target 'obj/eg_simula.o' failed
make[1]: *** [obj/eg_simula.o] Error 1
make[1]: Leaving directory '/home/phani/EGlib-2.6.20'
Makefile:23: recipe for target 'library' failed
make: *** [library] Error 2
After some searching, I have noticed that dbl_EGeHeap_t is not defined in the source code, and that seems to be throwing errors.
On searching online, it seems to be the case that it was defined in EGlib 2.6.15 (https://conexo.dii.uchile.cl/SVN/EGlib/EGlib2/tags/EGlib-2.6.15/TEmplate/dbl_eg_eheap.h), but the corresponding file in 2.6.20 does not have the definition.
Has anybody else experienced this? I badly need a solution to this.

Resources