您好,我正在尝试按照步骤guid来构建jpeg xl(我在Windows上并尝试为Linux构建x64版本)
之后:
docker run -u root:root -it --rm -v C:\Users\fred\source\tools\jpegxl\jpeg-xl-master -w /jpeg-xl gcr.io/jpegxl/jpegxl-builder
我正在运行容器,但是我不知道如何在其中运行命令:
CC=clang-6.0 CXX=clang++-6.0 ./ci.sh opt
我尝试使用CC = clang-6.0 CXX = clang ++-6.0 ./ci.sh opt,我得到 ./ ci.sh:没有这样的文件或目录 “ ls”什么也没显示
有人知道如何构建它吗?
答案 0 :(得分:1)
确保在容器内启动bash终端:
[[3, 3], [2, 2], [1, 1], [3, 2], [3, 1], [2, 1], [1, 2], [1, 3], [2, 3]]
我相信您的<body class="quiz">
<h1>Quiz on Important Facts</h1>
<div class="quiz-container">
<div id="quiz"></div>
</div>
<button id="previous">Previous Question</button>
<button id="next">Next Question</button>
<button id="submit">Submit Quiz</button>
<div id="results"></div>
</body>
$(document).ready(function(){
var quizContainer = $('#quiz');
var resultsContainer = $('#results');
var submitButton = $('#submit');
var output = [];
var mq ='';
const previousButton = $("#previous");
// const checkAnsweButton = $("#check");
const nextButton = $("#next");
var total = '';
var currentSlide = 0;
function buildQuiz(){
$.ajax({
url: './json/qa.json',
success: function(data){
//console.log(data.myQuestions);
mq = data.myQuestions;
mq.forEach(
(currentQuestion, questionNumber) => {
const answers = [];
for(letter in currentQuestion.answers){
answers.push(
`<label>
<input type="radio" name="question${questionNumber}" value="${letter}">
${letter} :
${currentQuestion.answers[letter]}
</label>`
);
}
output.push(
`<div class="slide">
<div class="question"> ${currentQuestion.question} </div>
<div class="answers"> ${answers.join("")} </div>
</div>
`
);
quizContainer.html(output.join(''));
const slides = $('#quiz').find(".slide");
total = slides.length;
showSlide(currentSlide);
});
}
})
}
buildQuiz();
function showResults() {
// gather answer containers from our quiz
const answerContainers = quizContainer.find('.answers');
// keep track of user's answers
let numCorrect = 0;
// for each question...
mq.forEach((currentQuestion, questionNumber) => {
// find selected answer
const answerContainer = answerContainers.eq(questionNumber);
const selector = $('input[type=radio]:checked');
const userAnswer = (answerContainer.find(selector) || {}).val();
//console.log($('input[type=radio]:checked').val())
// if answer is correct
if (userAnswer === currentQuestion.correctAnswer) {
// add to the number of correct answers
numCorrect++;
}
});
$(resultsContainer).html(`${numCorrect} out of ${mq.length}`);
}
function showSlide(n) {
//console.log(mq);
$('#quiz').find('.slide').eq(0).removeClass('active-slide');
$('#quiz').find('.slide').eq(n).addClass('active-slide');
$('#quiz').find('.slide').eq(n-1).removeClass('active-slide');
$('#quiz').find('.slide').eq(n+1).removeClass('active-slide');
currentSlide = n;
if (currentSlide === 0) {
previousButton.hide();
} else {
previousButton.show();
}
if (currentSlide === total - 1) {
nextButton.hide();
submitButton.show();
} else {
nextButton.show();
submitButton.hide();
}
}
var clickcount = 0;
function showNextSlide() {
const answerContainers = quizContainer.find('.answers');
if(clickcount == 2){
clickcount = 0;
}
if(clickcount == 0) {
console.log("next clicked once");
mq.forEach((currentQuestion, questionNumber) => {
// find selected answer
const answerContainer = answerContainers.eq(questionNumber);
const selector = $('input[type=radio]:checked');
const userAnswer = (answerContainer.find(selector) || {}).val();
//console.log(currentQuestion)
// if answer is correct
if (userAnswer === currentQuestion.correctAnswer) {
console.log("right answer")
console.log("correctAnswer - "+currentQuestion.correctAnswer)
console.log("userAnswer - "+$('input[type=radio]:checked').val())
// color the answers green
answerContainers.find('input').eq(questionNumber).parent().css("color","lightgreen");
}
// if answer is wrong or blank
else {
console.log("wrong answer")
console.log("correctAnswer - "+currentQuestion.correctAnswer)
console.log("userAnswer - "+$('input[type=radio]:checked').val())
//
// color the answers red
answerContainers.find('input').eq(questionNumber).parent().css("color","red");
}
//answerContainers.find('input').eq(questionNumber).prop('disabled',true)
});
}
else {
console.log("next clicked second time");
showSlide(currentSlide + 1);
}
clickcount += 1;
}
function showPreviousSlide() {
showSlide(currentSlide - 1);
}
submitButton.on('click', showResults);
previousButton.on("click", showPreviousSlide);
//checkAnsweButton.on('click', showResults);
nextButton.bind("click", showNextSlide);
})
{
"myQuestions" : [
{
"question": "Who invented JavaScript?",
"answers": {
"a": "Douglas Crockford",
"b": "Sheryl Sandberg",
"c": "Brendan Eich"
},
"correctAnswer": "c"
},
{
"question": "Which one of these is a JavaScript package manager?",
"answers": {
"a": "Node.js",
"b": "TypeScript",
"c": "npm"
},
"correctAnswer": "c"
},
{
"question": "Which tool can you use to ensure code quality?",
"answers": {
"a": "Angular",
"b": "jQuery",
"c": "RequireJS",
"d": "ESLint"
},
"correctAnswer": "d"
}
]
}
命令中缺少docker run -it <image> /bin/bash
。结果,您正在自己的环境(而不是容器)内执行clang的命令。
答案 1 :(得分:0)
您可以使用-e
示例
-e CC=clang-6.0 -e CXX=clang++-6.0
登录到容器的完整命令:
docker run -u root:root -it --rm -e CC=clang-6.0 -e CXX=clang++-6.0 -v C:\Users\fred\source\tools\jpegxl\jpeg-xl-master -w /jpeg-xl gcr.io/jpegxl/jpegxl-builder /bin/bash
答案 2 :(得分:0)
他们在不更新命令的情况下更新了图像,因此命令为
CC=clang-7 CXX=clang++-7 ./ci.sh opt
此处为争议: Can't build from docker image "Unknown clang version"